refactored controller declaration