orders refactoring