Use one dump and restore function for the pickle files.