Optimize the code, the same file data saved only once