diff --git a/workbench_access.admin.inc b/workbench_access.admin.inc
index 00281e1..640b204 100644
--- a/workbench_access.admin.inc
+++ b/workbench_access.admin.inc
@@ -562,24 +562,12 @@ function workbench_access_editor_form($form, &$form_state, $access_type, $access
     drupal_exit();
   }
 
-  // Get the list of user roles that can be assigned workbench access.
-  $roles = workbench_access_get_roles('access workbench access by role');
-
-  $query = db_select('users', 'u')
-    ->fields('u', array('uid', 'name'));
-  $query->join('workbench_access_user', 'wau', 'u.uid = wau.uid');
-  $query->join('users_roles', 'ur', 'u.uid = ur.uid');
-  $query->join('role_permission', 'rp', 'rp.rid = ur.rid');
-  $query->condition('wau.access_scheme', $access_type)
-    ->condition('wau.access_id', $access_type_id)
-    ->condition('ur.rid', array_keys($roles), 'IN')
-    ->extend('PagerDefault')->limit(25);
-  $result = $query->execute();
-  $rows = array();
+  // Get the list of users assigned to this section.
+  $users = workbench_access_user_editor_assignments($access_type, $access_type_id);
   $form['users']['#tree'] = TRUE;
-  foreach ($result as $account) {
-    $form['users'][$account->uid]['name'] = array('#markup' => l($account->name, 'user/' . $account->uid));
-    $form['users'][$account->uid]['remove'] = array(
+  foreach ($users as $uid => $name) {
+    $form['users'][$uid]['name'] = array('#markup' => l($name, 'user/' . $uid));
+    $form['users'][$uid]['remove'] = array(
       '#type' => 'checkbox',
       '#title' => t('Remove'),
     );
@@ -719,9 +707,6 @@ function workbench_access_role_form($form, &$form_state, $access_type, $access_t
     drupal_exit();
   }
 
-  // Build the list of user roles that can be assigned workbench access.
-  $roles = workbench_access_get_roles('access workbench access by role');
-
   // Form markup elements.
   $access_info = workbench_access_load($access_type, $access_type_id);
   $output = '<h2>' . t('%name editors by role', array('%name' => $access_info['name'])) . '</h2>';
@@ -729,18 +714,10 @@ function workbench_access_role_form($form, &$form_state, $access_type, $access_t
   $header = array(t('Editors'), t('Roles'));
   $rows = array();
   $access_rids = array();
-  if (!empty($roles)) {
-    $access_rids = db_query("SELECT war.rid FROM {workbench_access_role} war WHERE war.rid IN (:rids) AND war.access_scheme = :access_scheme AND war.access_id = :access_type_id", array(':rids' => array_keys($roles), ':access_scheme' => $access_type, ':access_type_id' => $access_type_id))->fetchCol();
-  }
-  $users = array();
-  if (!empty($access_rids)) {
-    $users = db_query("SELECT u.name, u.uid, r.name AS role FROM {users} u INNER JOIN {users_roles} ur ON ur.uid = u.uid LEFT JOIN {role} r ON r.rid = ur.rid WHERE ur.rid IN (:rids) AND u.status > 0", array(':rids' => $access_rids));
-  }
-  $users_by_role = array();
-  foreach ($users as $data) {
-    $users_by_role[$data->uid]['name'] = $data->name;
-    $users_by_role[$data->uid]['roles'][] = check_plain($data->role);
-  }
+
+  // Build the list of user roles assigned to this section.
+  $roles = workbench_access_get_roles('access workbench access by role');
+  $users_by_role = workbench_access_user_role_assignments($access_type, $access_type_id);
   foreach ($users_by_role as $uid => $item) {
     $rows[] = array(
       l($item['name'], 'user/' . $uid),
diff --git a/workbench_access.module b/workbench_access.module
index 29880dc..2425cd6 100644
--- a/workbench_access.module
+++ b/workbench_access.module
@@ -2024,3 +2024,77 @@ function workbench_access_query_term_access_alter(QueryAlterableInterface $query
     }
   }
 }
+
+/**
+ * Return an array of users who are editors for a section.
+ *
+ * @param $access_type
+ *   The type of access requested (e.g. taxonomy).
+ * @param $access_type_id
+ *   The id for this specific access (e.g. a taxonomy term tid).
+ * @param $roles
+ *   An array of role IDs. If this parameter is supplied, restrict the results
+ *   to users with the specified roles.
+ * @param $pager
+ *   If greater than zero, use a pager so results are limited.
+ *
+ * @return
+ *   An array of user names, keyed by user id.
+ */
+function workbench_access_user_editor_assignments($access_type, $access_type_id, $roles = array(), $pager = 0) {
+  if (!$roles) {
+    $roles = array_keys(workbench_access_get_roles('access workbench access by role'));
+  }
+  $query = db_select('users', 'u')
+    ->fields('u', array('uid', 'name'));
+  $query->join('workbench_access_user', 'wau', 'u.uid = wau.uid');
+  $query->join('users_roles', 'ur', 'u.uid = ur.uid');
+  $query->join('role_permission', 'rp', 'rp.rid = ur.rid');
+  $query->condition('wau.access_scheme', $access_type)
+    ->condition('wau.access_id', $access_type_id)
+    ->condition('ur.rid', $roles, 'IN');
+  if ($pager) {
+    $query->extend('PagerDefault')->limit($pager);
+  }
+  $result = $query->execute();
+  $users = array();
+  foreach ($result as $account) {
+    $users[$account->uid] = $account->name;
+  }
+  return $users;
+}
+
+/**
+ * Return an array of users who are editors for a section.
+ *
+ * @param $access_type
+ *   The type of access requested (e.g. taxonomy).
+ * @param $access_type_id
+ *   The id for this specific access (e.g. a taxonomy term tid).
+ * @param $roles
+ *   An array of role IDs. If this parameter is supplied, restrict the results
+ *   to users with the specified roles.
+ *
+ * @return
+ *   An array users, keyed by user id, with the user name and an array of 
+ *   applicable roles as elements of the array.
+ */
+function workbench_access_user_role_assignments($access_type, $access_type_id, $roles = array()) {
+  // Build the list of user roles that can be assigned workbench access.
+  if (!$roles) {
+    $roles = array_keys(workbench_access_get_roles('access workbench access by role'));
+  }
+  if (!empty($roles)) {
+    $access_rids = db_query("SELECT war.rid FROM {workbench_access_role} war WHERE war.rid IN (:rids) AND war.access_scheme = :access_scheme AND war.access_id = :access_type_id", array(':rids' => $roles, ':access_scheme' => $access_type, ':access_type_id' => $access_type_id))->fetchCol();
+  }
+  $users = array();
+  if (!empty($access_rids)) {
+    $users = db_query("SELECT u.name, u.uid, r.name AS role FROM {users} u INNER JOIN {users_roles} ur ON ur.uid = u.uid LEFT JOIN {role} r ON r.rid = ur.rid WHERE ur.rid IN (:rids) AND u.status > 0", array(':rids' => $access_rids));
+  }
+  $users_by_role = array();
+  foreach ($users as $data) {
+    $users_by_role[$data->uid]['name'] = $data->name;
+    $users_by_role[$data->uid]['roles'][] = $data->role;
+  }
+  return $users_by_role;
+}
