Refactor sorting

Refactor sorting code in WebInterfaceWorkersServlet.java