some functions rewrited