rewrite some functions with parser