diff --git a/password_policy.module b/password_policy.module
index 11d873a..9d73aff 100644
--- a/password_policy.module
+++ b/password_policy.module
@@ -57,27 +57,38 @@ function password_policy_ajax_check() {
 
     $total = 0;
     $errors = array();
+    $build = array(
+      'intro' => array(
+        '#markup' => t('Password does not meet the following requirements:'),
+      ),
+      'errors' => array(
+        '#theme' => 'item_list',
+        '#items' => array(),
+      ),
+    );
+
     foreach ($policies as $policy) {
       $total += count($policy->messages());
-      $errors = $errors + $policy->check($password, $account);
+      $build['errors']['#items'] = $policy->check($password, $account);
+    }
+    if ($is_trimmed) {
+      $build['trimmed'] = t('Password has spaces at the beginning or end which are ignored.');
     }
-    $sus_count = $total - count($errors);
 
-    $score = ($sus_count / $total) * 100;
+    $score = array();
+    $score['total'] = $total;
+    $score['error_count'] = count($build['errors']['#items']);
+    $score['sus_count'] = $total - $score['error_count'];
+    $score['score'] = ($score['sus_count'] / $score['total']) * 100;
 
-    $msg = '';
-    if (!empty($errors)) {
-      $msg .= t('Password does not meet the following requirements:');
-      $msg .= theme('item_list', array('items' => $errors));
-      if ($is_trimmed) {
-        $msg .= t('Password has spaces at the beginning or end which are ignored.');
-      }
-    }
+    drupal_alter(__FUNCTION__, $build, $score);
+
+    $msg = !empty($score['error_count']) ? drupal_render($build) : '';
 
     $return = array(
       'message' => $msg,
-      'strength' => $score,
-      'indicatorText' => t('@sus_count of @total', array('@sus_count' => $sus_count, '@total' => $total)),
+      'strength' => $score['score'],
+      'indicatorText' => t('@sus_count of @total', array('@sus_count' => $score['sus_count'], '@total' => $score['total'])),
     );
 
     drupal_json_output($return);
