diff --git a/uber_affiliate.inc b/uber_affiliate.inc
index 05146e5..0b92db7 100644
--- a/uber_affiliate.inc
+++ b/uber_affiliate.inc
@@ -261,7 +261,7 @@ function affiliate_validate_click($affid, $dest, $verify_node_type = TRUE) {
         return TRUE;
       }
       if ($verify_node_type) {
-        $node = node_load($nid);
+        $node = \Drupal::service('entity_type.manager')->getStorage('node')->load($nid);
         $type = $node->type;
         $allowed_node_types = \Drupal::state()->get('affiliate_module_allowed_node_types', array());
         if (!in_array($type, (array) $allowed_node_types)) {
@@ -522,7 +522,7 @@ function affiliate_validate_uid($affid = 0) {
 }
 
 function affiliate_click_denied($uid) {
-  $account = user_load($uid);
+  $account = \Drupal::service('entity_type.manager')->getStorage('user')->load($uid);
   $denied_users = explode("\n", \Drupal::state()->get('affiliate_module_ignored_users', ''));
   if (in_array($account->name, $denied_users)) {
     return TRUE;
@@ -674,7 +674,7 @@ function affiliate_user_page_output_details($acctid) {
 
   $rows = array();
   foreach ($result as $res) {
-    $click_time = format_date($res->click_time);
+    $click_time = \Drupal::service('date.formatter')->format($res->click_time);
     $referrer = url($res->referrer);
     $rows[] = array($click_time, $referrer);
   }
@@ -710,10 +710,10 @@ function affiliate_user_page_output_top($acctid) {
   $rows = array();
   foreach ($result as $affiliate) {
     $affiliate_uid = $affiliate->uid;
-    $affiliate_name = user_load($affiliate_uid)->name;
+    $affiliate_name = \Drupal::service('entity_type.manager')->getStorage('user')->load($affiliate_uid)->name;
     $affiliate_uid_display =  l(t('@uid - @name', array('@uid' => $affiliate_uid, '@name' => $affiliate_name)), drupal_get_path_alias('user/' . $affiliate_uid));
     $affiliate_active = $affiliate->active ? t('Yes') : t('No');
-    $affiliate_created = format_date($affiliate->created);
+    $affiliate_created = \Drupal::service('date.formatter')->format($affiliate->created);
     $payouts_owed_display = $payouts_symbol . $affiliate->payouts_owed;
     $payouts_paid_display = $payouts_symbol . $affiliate->payouts_paid;
     if ($payouts_symbol_pos == 2) {
@@ -769,7 +769,7 @@ function affiliate_admin_overviewpage_output() {
     $affiliate_uid_display =  l($affiliate_uid, drupal_get_path_alias('user/' . $affiliate_uid));
     $affiliate_name_display =  l($affiliate_name, drupal_get_path_alias('user/' . $affiliate_uid));
     $affiliate_active = $affiliate->active ? t('Yes') : t('No');
-    $affiliate_created = format_date($affiliate->created);
+    $affiliate_created = \Drupal::service('date.formatter')->format($affiliate->created);
     $payouts_owed_display = $payouts_symbol . $affiliate->payouts_owed;
     $payouts_paid_display = $payouts_symbol . $affiliate->payouts_paid;
     $payouts_form = '';
@@ -778,7 +778,7 @@ function affiliate_admin_overviewpage_output() {
       $payouts_paid_display = $affiliate->payouts_paid . $payouts_symbol;
     }
     if (user_access('administer affiliate settings') || user_access('administer affiliate payouts')) {
-      $payouts_form .= drupal_render(drupal_get_form('affiliate_payout_inlineform', $affiliate_uid));
+      $payouts_form .= \Drupal::service('renderer')->render(drupal_get_form('affiliate_payout_inlineform', $affiliate_uid));
     }
     $rows[] = array($affiliate_uid_display, $affiliate_name_display, $affiliate_active, $affiliate_created, $affiliate->clicks, $affiliate->referrals, $payouts_owed_display, $payouts_paid_display, $payouts_form);
   }
@@ -990,14 +990,14 @@ function affiliate_admin_contentform_submit($form, $form_state) {
   $rebuild_caches = (int) $form_state['values']['affiliate_module_flush_all_caches_on_admin_content_form_submit'];
   if ($rebuild_caches) {
     drupal_flush_all_caches();
-    drupal_set_message(t('All caches have been cleared and the menu router has been rebuilt to reflect your updated affiliate menu path.'));
+    \Drupal::messenger()->addStatus(t('All caches have been cleared and the menu router has been rebuilt to reflect your updated affiliate menu path.'));
   }
   // Remind the admin to rebuild the site's menus if the affiliate menu path has changed.
   else if ($menu_path_submitted != $menu_path_current) {
-    drupal_set_message(t('The click-thru menu path appears to have changed, but no caches have been flushed and the menu router has not been updated. If you encounter "Page not found" errors, please consider re-submitting this form but selecting <em>Yes</em> under the <em>Flush all caches</em> option. Doing so will help to ensure that any stale data is removed from the database.'), 'warning');
+    \Drupal::messenger()->addWarning(t('The click-thru menu path appears to have changed, but no caches have been flushed and the menu router has not been updated. If you encounter "Page not found" errors, please consider re-submitting this form but selecting <em>Yes</em> under the <em>Flush all caches</em> option. Doing so will help to ensure that any stale data is removed from the database.'));
   }
   else if (!drupal_valid_path($menu_path_submitted)) {
-    drupal_set_message(t('Warning: it appears as though your site requires its caches to be flushed and its menu router to be updated. Until such time, your affiliates will likely encounter "Page not found" errors due to stale information inside the database. To remove the stale information, please consider re-submitting this form but selecting <em>Yes</em> under the <em>Flush all caches</em> option.'), 'warning');
+    \Drupal::messenger()->addWarning(t('Warning: it appears as though your site requires its caches to be flushed and its menu router to be updated. Until such time, your affiliates will likely encounter "Page not found" errors due to stale information inside the database. To remove the stale information, please consider re-submitting this form but selecting <em>Yes</em> under the <em>Flush all caches</em> option.'));
   }
 }
 
