Adapted store_to_file and load_to_file.