Moving script code to ScriptPlugin ...