HttpHandler refactored a little bit