move some functions to private