Optimised the ScriptingManager class a bit