Moved private functions in controllers to their respective services, some minor refactoring