simplify some function