refactoring service layer, better separation of concerns