move some code