added some usefull routines (NOTE they must be moved soon to a common place to be used by other modules)