Refactored sync client into its own class.