ChatServlet refactoring