moved some functions to utils class