Move into own function to allow manual saves