refactoring service controller