Moving saving code into its own partial class.