I think you're right a bout first part it we won't repeat same code also. but about using ```ioutil.WriteFile``` you mean in nonAtomicSave or instead of ```os.Rename(f.Name(), name)```