refactored controller and jsp