simplified file saving method, reorganization