refactor the order controller