[cloud-sync] - Refactor code.