refactor request handler
refactor request handler