refactor and comment undo