service layer refactor