controllers and services refactored