Refactored MainPageServlet