adding refactored controller