refactored filesync