refactored services and unit tests a bit