move some logic