simplify some functions.