separated save files to function