protected function initializeCDN($token, $catalog) {
    $cdn = $this->cxt('use_cdn', FALSE);

    // No CDN should be enabled.
    if (empty($cdn)) {
      return FALSE;
    }
    // Use the CDN object, if provided.
    elseif ($cdn instanceof \HPCloud\Storage\CDN) {
      $this->cdn = $cdn;
    }
    // Or try to create a new CDN from the catalog.
    else {
      if (empty($catalog)) {
        $ident = $this->authenticate();
        $catalog = $ident->serviceCatalog();
        $token = $ident->token();
      }
      $region = $this->cxt('region');
      $this->cdn = \HPCloud\Storage\CDN::newFromServiceCatalog($catalog, $token, $region);
    }

    if (!empty($this->cdn)) {
      $this->store->useCDN($this->cdn);
    }
    return TRUE;
  }