move some function to order calculator