refactoring of OrderRepository