move some functions to another file