improved ScriptLoader