moved order methods from controller to model