Refactoring the refresh_editor method in TaskEditor.