diff --git a/masquerade.install b/masquerade.install
index d062da1..dfe1419 100644
--- a/masquerade.install
+++ b/masquerade.install
@@ -6,42 +6,17 @@
  */
 
 /**
- * Implements hook_schema().
+ * Implements hook_install().
  */
-function masquerade_schema() {
-  $schema['masquerade'] = array(
-      'description' => 'Each masquerading user has their session recorded into the masquerade table. Each record represents a masquerading user.',
-      'fields' => array(
-        'sid' => array(
-          'description' => 'The current session for this masquerading user corresponding to their {sessions}.sid.',
-          'type' => 'varchar',
-          'length' => '64',
-          'not null' => TRUE,
-          'default' => ''),
-        'uid_from' => array(
-          'description' => 'The {users}.uid corresponding to a session.',
-          'type' => 'int',
-          'not null' => TRUE,
-          'default' => 0,
-          'disp-width' => '10'),
-        'uid_as' => array(
-          'description' => 'The {users}.uid this session is masquerading as.',
-          'type' => 'int',
-          'not null' => TRUE,
-          'default' => 0,
-          'disp-width' => '10'),
-      ),
-      'indexes' => array(
-        'sid' => array('sid', 'uid_from'),
-        'sid_2' => array('sid', 'uid_as'),
-      ),
-  );
-  return $schema;
+function masquerade_install() {
+  module_set_weight('masquerade', -10);
 }
 
 /**
- * Implements hook_install().
+ * Remove the {masquerade} table.
  */
-function masquerade_install() {
-  module_set_weight('masquerade', -10);
+function masquerade_update_8200() {
+  if (db_table_exists('masquerade')) {
+    db_drop_table('masquerade');
+  }
 }
diff --git a/masquerade.module b/masquerade.module
index 28cb064..f401a49 100644
--- a/masquerade.module
+++ b/masquerade.module
@@ -34,44 +34,6 @@ function masquerade_permission() {
 }
 
 /**
- * Implements hook_init().
- */
-function masquerade_init() {
-  global $user;
-
-  if (isset($_SESSION['masquerading'])) {
-    return;
-  }
-  // Try to load masqing uid from masquerade table.
-  $uid = db_query("SELECT uid_from FROM {masquerade} WHERE sid = :sid AND uid_as = :uid_as", array(
-    ':sid' => session_id(),
-    ':uid_as' => $user->uid,
-  ))->fetchField();
-  if ($uid) {
-    $_SESSION['masquerading'] = $uid;
-  }
-  elseif (isset($_SESSION['masquerading'])) {
-    unset($_SESSION['masquerading']);
-  }
-}
-
-/**
- * Implements hook_cron().
- *
- * Cleanup masquerade records where people didn't use the switch back link
- * that would have cleanly removed the user switch record.
- */
-function masquerade_cron() {
-  // see http://drupal.org/node/268487 before modifying this query
-  $subquery = db_select('sessions', 's');
-  $subquery->addField('s', 'sid');
-
-  $query = db_delete('masquerade');
-  $query->condition('sid', $subquery, 'NOT IN');
-  $query->execute();
-}
-
-/**
  * Implements hook_menu().
  */
 function masquerade_menu() {
@@ -178,22 +140,6 @@ function masquerade_user_is_masquerading() {
 }
 
 /**
- * Implements hook_user_logout().
- */
-function masquerade_user_logout($account) {
-  if (!empty($account->masquerading)) {
-    global $user;
-    $real_user = user_load($user->masquerading);
-    watchdog('masquerade', "User %user no longer masquerading as %masq_as.", array('%user' => $real_user->name, '%masq_as' => $user->name), WATCHDOG_INFO);
-
-    $query = db_delete('masquerade');
-    $query->condition('sid', session_id());
-    $query->condition('uid_as', $account->uid);
-    $query->execute();
-  }
-}
-
-/**
  * Implements hook_user_view().
  */
 function masquerade_user_view(User $account, $display, $view_mode, $langcode) {
@@ -348,14 +294,6 @@ function masquerade_switch_user(User $target_account) {
 
   $_SESSION['masquerading'] = $user->uid;
 
-  $query = db_insert('masquerade');
-  $query->fields(array(
-    'uid_from' => $user->uid,
-    'uid_as' => $target_account->uid,
-    'sid' => session_id(),
-  ));
-  $query->execute();
-
   watchdog('masquerade', 'User %username masqueraded as %target_username.', array(
     '%username' => $user->name,
     '%target_username' => $target_account->name,
@@ -398,15 +336,11 @@ function masquerade_switch_back_page() {
  */
 function masquerade_switch_back() {
   global $user;
-  $uid = db_query('SELECT uid_from FROM {masquerade} WHERE sid = :sid AND uid_as = :uid_as', array(
-    ':sid' => session_id(),
-    ':uid_as' => $user->uid,
-  ))->fetchField();
-
-  // Clean-up session masquerate.
-  db_delete('masquerade')
-    ->condition('sid', session_id())
-    ->execute();
+
+  if (!masquerade_user_is_masquerading()) {
+    return FALSE;
+  }
+  $uid = $_SESSION['masquerading'];
 
   $old_user = $user;
 
