Code cleanup ScriptWidget