Refactoring to add file sync test code