Refactoring updateFile so that the edit after delete problem is gone.