Move editing to separate function, update .gitignore