Again, this logic probably shouldn't be in the servlet.