refactoring for the new services - added tests too