Refactoring - replace text editor