refactor resource servlets