Refactoring HTTPHandler