Adjusted data saving and loading processes in all three files to reduce code duplication