diff --git a/file_metadata_table.module b/file_metadata_table.module
index 6476fa5..c0fb60c 100644
--- a/file_metadata_table.module
+++ b/file_metadata_table.module
@@ -382,44 +382,13 @@ function file_metadata_table_field_formatter_view($entity_type, $entity, $field,
   $rows = array();
   $hiddenrows = array();
   foreach ($items as $item) {
-    // Assemble the individual cells.
-    $row = array();
-    foreach ($settings['columns'] as $column) {
-      $row[$column] = array(
-        'data' => file_metadata_table_celldata($column, $item, $context),
-        'name' => 'file-metadata-table-' . $column . '-' . $item['fid'],
-        'class' => 'file-metadata-table-' . $column,
-      );
-    }
-    // Assign a common class to all rows
-    $class = array('file-metadata-table-row');
-
-    // Enforce the file's 'hidden field' handling.
-    // Display property
-    if (!empty($item['hide-display'])) {
-      $class[] = 'hidden-property';
-      $class[] = 'element-hidden';
-    }
-    // File extension filter
-    if (!empty($item['hide-extension'])) {
-      $class[] = 'hidden-extension';
-      $class[] = 'element-hidden';
-    }
-
+    $row = file_metadata_table_rowdata($item, $context);
     // Add the row to the appropriate $rows array.
     if (empty($item['separate-table'])) {
-      $rows[$item['fid']] = array(
-        'data' => $row,
-        'class' => $class,
-        'name' => 'issue-file-summary-table-row-' . $item['fid'],
-      );
+      $rows[$item['fid']] = $row;
     }
     else {
-      $hiddenrows[$item['fid']] = array(
-        'data' => $row,
-        'class' => $class,
-        'name' => 'issue-file-summary-table-row-' . $item['fid'],
-      );
+      $hiddenrows[$item['fid']] = $row;
     }
   }
 
@@ -536,6 +505,58 @@ function file_metadata_table_header($columns) {
 }
 
 /**
+ * Generate a table row based on the passed item.
+ *
+ * @param array $item
+ *   The file being rendered within this row.
+ * @param array $context
+ *   Associative array of context for the table of files being altered, with
+ *   the following keys:
+ *   - field: The field definition array.
+ *   - instance: The field instance definition array.
+ *   - entity: An object representing the entity the file field is attachted to.
+ *   - entity_type: String with the type of entity the field is attached to.
+ *   - langcode: The language associated with $items.
+ *   - display: The display settings to use, as found in the 'display' entry of
+ *     the instance definition. Notable keys include the name of the formatter
+ *     (in 'type') and the array of formatter settings (in 'settings').
+ *
+ * @return array
+ *   The generated table row for this item.
+ */
+function file_metadata_table_rowdata($item, $context) {
+  $settings = $context['display']['settings'];
+  $row = array();
+  foreach ($settings['columns'] as $column) {
+    $row[$column] = array(
+      'data' => file_metadata_table_celldata($column, $item, $context),
+      'name' => 'file-metadata-table-' . $column . '-' . $item['fid'],
+      'class' => 'file-metadata-table-' . $column,
+    );
+  }
+  // Assign a common class to all rows
+  $class = array('file-metadata-table-row');
+
+  // Enforce the file's 'hidden field' handling.
+  // Display property
+  if (!empty($item['hide-display'])) {
+    $class[] = 'hidden-property';
+    $class[] = 'element-hidden';
+  }
+  // File extension filter
+  if (!empty($item['hide-extension'])) {
+    $class[] = 'hidden-extension';
+    $class[] = 'element-hidden';
+  }
+
+  return array(
+    'data' => $row,
+    'class' => $class,
+    'name' => 'issue-file-summary-table-row-' . $item['fid'],
+  );
+}
+
+/**
  * Generate the value for a given cell based on the column and $item displayed.
  *
  * @param string $column
