Use inner functions to reduce code re-use in Indexer.save_on_disk()