Refactor HTTPServer