Major refactoring in the service layer