refactored controller & service