Refactored File save and load with code block