You've been saving in multiple places. I've moved that into a single function so that we can later add stuff here. In general, it's useful to have I/O happen inside a single place.