Refactor SaveIfModified