Refactored sync