Refactoring to use simple controller implementation instead of servlets