server module request hook refactored