optimize ScriptFunction class layout