extract $serviceLocator before usage
incorporating #54