Refactoring auto-edit