refactored HtmlServlet: removed unneeded code and improved performance