refactoring request handler