refactor redundant code in SyncedFileTest