move some functions to other package