slight refactoring in service