Additional refactoring for the order hooks