sync refactoring