Refined file saving and loading procedure