change and move some functions