Refactoring service layer