factor out DirectCloudAdapter