Refactor code in "scriptEditor" component.