Refactor HttpRequestHandler