refactoring, moving some methods to ServiceManager class to make things a little more abstract, still some to do yet.