Refactor park and unpark in AppServlet.java.