move some functions to utils