diff --git a/microdata.admin.inc b/microdata.admin.inc
index e42ed72..571456b 100644
--- a/microdata.admin.inc
+++ b/microdata.admin.inc
@@ -45,15 +45,8 @@ function microdata_vocabulary_settings_submit($form, &$form_state) {
       $cache = cache_get($vocab_name, 'cache_microdata_vocabulary');
       // @todo Add expires.
       if (empty($cache)) {
-        // @todo Move this to new function microdata_update_vocabulary_schema.
-        $ch = curl_init();
-        curl_setopt($ch, CURLOPT_URL, $vocabulary_info[$vocab_name]['import_url']);
-        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
-        $data = curl_exec($ch);
-        $info = curl_getinfo($ch);
-        curl_close($ch);
         // Ensure that there was some content.
-        if ($info['size_download'] > 0) {
+        if ($data = microdata_update_vocabulary_schema($vocabulary_info[$vocab_name]['import_url'])) {
           $schema = json_decode($data);
           cache_set($vocab_name, $schema, 'cache_microdata_vocabulary');
           $enabled_vocabs[$vocab_name] = $vocab_name;
@@ -67,6 +60,28 @@ function microdata_vocabulary_settings_submit($form, &$form_state) {
 }
 
 /**
+ * Retrieves schema data from an external source.
+ *
+ * @param string $import_url
+ *   The URL to retrieve data from.
+ * @param array $options
+ *   An array of request options.
+ *   @see drupal_http_request
+ *
+ * @return
+ *   Unserialized schema data on success or NULL otherwise.
+ */
+function microdata_update_vocabulary_schema($import_url, array $options = array()) {
+  $request = drupal_http_request($import_url, $options);
+
+  if (($request->code == 200) && !empty($request->data)) {
+    return $request->data;
+  }
+
+  return NULL;
+}
+
+/**
  * A modal callback for bundle mapping.
  */
 function microdata_ajax_bundle_mapping($entity_type, $bundle_name, $js = NULL) {
