Document and refactor the servlet wrapper