Refactor request handler into own module