[cloud-sync] - Refactor cloud sync.