refactored libraries to use ScriptInjector.