Refactored controllers to use services