Refactored sync connection