Cleaned up code in Servlet