refactoring sync client