little refactoring
Refactoring updateEditorAndExecuteCode method