sync refactoring - not completed!