diff --git a/includes/tvi.query.inc b/includes/tvi.query.inc
index 52f1c63..fe786b3 100755
--- a/includes/tvi.query.inc
+++ b/includes/tvi.query.inc
@@ -20,7 +20,7 @@ function tvi_default_settings($type = TVI_TYPE_TERM, $xid = 0) {
 
   $settings->is_default = TRUE;
 
-  return $settings;  
+  return $settings;
 }
 
 //------------------------------------------------------------------------------
@@ -30,10 +30,14 @@ function tvi_default_settings($type = TVI_TYPE_TERM, $xid = 0) {
  * flag is set.
  */
 function tvi_load_settings($xid, $type = TVI_TYPE_TERM, $return_default = TRUE) {
+
   if ($type == TVI_TYPE_VOCAB) {
     $vocabulary = taxonomy_vocabulary_load($xid);
     $xid = $vocabulary->machine_name;
   }
+  elseif ($type == TVI_TYPE_TERM && module_exists('uuid')) {
+    $xid = reset(entity_get_uuid_by_id('taxonomy_term', array($xid)));
+  }
 
   $settings = variable_get('tvi_' . $type . '_' . $xid);
 
@@ -65,10 +69,14 @@ function tvi_update_settings($settings) {
  * the database.
  */
 function tvi_remove_settings($xid, $type = TVI_TYPE_TERM) {
+
   if ($type == TVI_TYPE_VOCAB) {
     $vocabulary = taxonomy_vocabulary_load($xid);
     $xid = $vocabulary->machine_name;
   }
+  elseif ($type == TVI_TYPE_TERM && module_exists('uuid')) {
+    $xid = reset(entity_get_uuid_by_id('taxonomy_term', array($xid)));
+  }
 
   variable_del('tvi_' . $type . '_' . $xid);
 }
diff --git a/tvi.install b/tvi.install
index a0a45a9..24476a0 100755
--- a/tvi.install
+++ b/tvi.install
@@ -1,58 +1,6 @@
 <?php
 
 /**
- * Implementation of hook_schema().
- * 
- * @see http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_schema/7
- */
-function tvi_schema() {
-	
-	$schema['tvi_settings'] = array(
-		'description' => 'Stores data relating a view display with a taxonomy term or vocabulary.',
-    'fields' => array(
-      'type' => array(
-        'type' => 'varchar',
-        'length' => 50,
-        'not null' => TRUE,
-        'default' => TVI_TYPE_TERM,
-        'description' => 'The type of taxonomy view setting. Can be; TVI_TYPE_TERM or TVI_TYPE_VOCAB.',
-      ),
-      'xid' => array(
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'Taxonomy vocabulary or term ID.',
-      ),
-      'view_name' => array(
-        'type' => 'varchar',
-        'length' => 128,
-        'not null' => TRUE,
-        'default' => '',
-        'description' => 'The view name that is used for this taxonomy display.',
-      ),
-      'display' => array(
-        'type' => 'varchar',
-        'length' => 255,
-        'not null' => TRUE,
-        'default' => 'default',
-        'description' => 'The view display to use.',
-      ),
-      'status' => array(
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'not null' => TRUE,
-        'default' => 0,
-        'description' => 'A flag to indicate whether to use or not.',
-      ),
-    ),
-    'primary key' => array('type', 'xid'),
-  );
-	
-  return $schema;
-}
-
-/**
  * Implementation of hook_install().
  * 
  * @see http://api.drupal.org/api/drupal/modules--system--system.api.php/function/hook_install/7
@@ -71,4 +19,66 @@ function tvi_install() {
           ->condition('name', 'tvi')
           ->fields(array('weight' => $view_info->weight + 5))
           ->execute();
-}
\ No newline at end of file
+}
+
+/**
+ * Implements hook_uninstall().
+ */
+function tvi_uninstall() {
+  db_delete('variable')
+    ->condition('name', 'tvi_%', 'LIKE');
+}
+
+/*
+ * Implements hook_update_N().
+ * 
+ * Replace xid int field by a varchar field to allow uuid usage.
+ */
+function tvi_update_7000(&$sandbox) {
+  db_drop_primary_key('tvi_settings');
+  db_change_field('tvi_settings', 'xid', 'xid', 
+    array(
+      'type' => 'varchar',
+      'length' => 255,
+      'not null' => TRUE,
+      'default' => '',
+      'description' => 'Taxonomy vocabulary or term ID or UUID.',
+    ), 
+    array('primary key' => array('type', 'xid'))
+  );
+}
+
+/**
+ * Replace vids by machine_names.
+ */
+function tvi_update_7001() {
+  $settings = db_select('tvi_settings', 'tvi')
+                ->fields('tvi')
+                ->condition('tvi.type', TVI_TYPE_VOCAB)
+                ->execute()
+                ->fetchObject();
+  foreach ($settings as $setting) {
+    $voc = taxonomy_vocabulary_load($setting->xid);
+    db_update('tvi_settings')
+      ->fields(array('xid' => $voc->machine_name))
+      ->condition('type', $setting->type)
+      ->condition('xid', $setting->xid)
+      ->execute();
+  }
+}
+
+
+/**
+ * Drop schema in favor of {variable} table.
+ */
+function tvi_update_7002() {
+  tvi_include('query');
+  $settings = db_select('tvi_settings', 'tvi')
+                ->fields('tvi')
+                ->execute()
+                ->fetchObject();
+  foreach ($settings as $setting) {
+    tvi_update_settings($setting);
+  }
+  db_drop_table('tvi_settings');
+}
