Moved ScriptFunction to its own file