Improve save state handling

Remove deprecated method and save modified files before running.