diff --git a/simplesamlphp_auth.install b/simplesamlphp_auth.install
index cbc5d7c..bcc5804 100644
--- a/simplesamlphp_auth.install
+++ b/simplesamlphp_auth.install
@@ -9,38 +9,18 @@
  * Implements hook_install().
  */
 function simplesamlphp_auth_install() {
-
-  $abc = 'test';
-
-  // Necessary userprotect settings.
-  $query1 = db_result(db_query('SELECT perm FROM {permission} WHERE rid = 2'));
-
-  if ($query1) {
-    $new_perms = str_replace(', change own password', '', $query1);
-    $new_perms = str_replace('change own password', '', $new_perms);
-    $query2 = db_query('UPDATE {permission} SET perm = "' . $new_perms . '" WHERE rid = 2');
-  }
+  user_role_revoke_permissions(DRUPAL_AUTHENTICATED_RID, array('change own password'));
 
   // Disable the open registration to the site and store the original setting.
   $original = variable_get('user_register', 1);
   variable_set('user_register', 0);
   variable_set('simplesamlphp_auth_user_register_original', $original);
-
-  if ($query1) {
-    drupal_set_message(st('The simpleSAMLphp authentication module was installed successfully.'));
-  }
-  else {
-    drupal_set_message(st('There was an error installing the simpleSAMLphp authentication database tables.'), 'error');
-  }
 }
 
 /**
  * Implements hook_uninstall().
  */
 function simplesamlphp_auth_uninstall() {
-  // Show Login block by default.
-  $query1 = db_query('UPDATE {block} SET status="1" WHERE module="user" AND delta="0"');
-
   // Restore the original user registration directive.
   $original = variable_get('simplesamlphp_auth_user_register_original', 1);
   variable_set('user_register', $original);
@@ -60,11 +40,4 @@ function simplesamlphp_auth_uninstall() {
   variable_del('simplesamlphp_auth_registerusers');
   variable_del('simplesamlphp_auth_allowdefaultlogin');
   variable_del('simplesamlphp_auth_allowdefaultloginusers');
-
-  if ($query1) {
-    drupal_set_message(st('The simpleSAMLphp authentication module was uninstalled successfully.'));
-  }
-  else {
-    drupal_set_message(st('There was an error removing the simpleSAMLphp authentication database tables.'), 'error');
-  }
 }
