refactoring of service locator