diff --git a/file_entity.admin.inc b/file_entity.admin.inc
index adbba0d..817997d 100644
--- a/file_entity.admin.inc
+++ b/file_entity.admin.inc
@@ -1,5 +1,7 @@
 <?php
 
+require dirname(__FILE__) . '/file_entity.pages.inc';
+
 /**
  * @file
  * Administrative interface for file type configuration.
@@ -9,9 +11,8 @@
  * Administrative form for browsing files and performing operations on them.
  */
 function file_entity_admin_files($form, &$form_state) {
-
   if (!empty($form_state['values']['operation'])) {
-    // The form is being rebuild because an operation requiring confirmation
+    // The form is being rebuilt because an operation requiring confirmation
     // was selected.  Hand off to the callback of the operation at this point
     // which should return a confirm form.
     $operation = $form_state['values']['operation'];
@@ -125,62 +126,6 @@ function file_entity_admin_files_submit($form, &$form_state) {
 }
 
 /**
- * Confirm the request to delete files.
- */
-function file_entity_multiple_delete_confirm($files) {
-  $form = array();
-  $files = array_filter($files);
-
-  $form['files'] = array('#tree' => TRUE);
-  $form['file_titles'] = array('#theme' => 'item_list');
-
-  $files = file_load_multiple(array_keys($files));
-  foreach ($files as $fid => $file) {
-    $form['files'][$fid] = array(
-      '#type' => 'value',
-      '#value' => $fid,
-    );
-    $form['file_titles']['#items'][] = check_plain($file->filename);
-  }
-  $form['operation'] = array('#type' => 'hidden', '#value' => 'delete');
-  $form['#submit'][] = 'file_entity_multiple_delete_confirm_submit';
-
-  $confirm_question = format_plural(count($files),
-                                  'Are you sure you want to delete this file?',
-                                  'Are you sure you want to delete these files?');
-
-  return confirm_form($form,
-    $confirm_question,
-    isset($redirect_on_cancel) ? $redirect_on_cancel : current_path(),
-    t('This action cannot be undone.'),
-    t('Delete'),
-    t('Cancel'));
-}
-
-/**
- * Attempt to delete files and notify the user of the result.
- */
-function file_entity_multiple_delete_confirm_submit($form, &$form_state) {
-  if ($form_state['values']['confirm']) {
-    $files = file_load_multiple(array_keys($form_state['values']['files']));
-    foreach ($files as $fid => $file) {
-      $result = file_delete($file);
-      if (is_array($result)) {
-        drupal_set_message(t('The file @title is in use and cannot be deleted.', array('@title' => $file->filename)), 'warning');
-      }
-      elseif (!$result) {
-        drupal_set_message(t('The file @title was not deleted due to an error.', array('@title' => $file->filename)), 'error');
-      }
-      else {
-        $message = t('File @title was deleted', array('@title' => $file->filename));
-        watchdog('file', $message);
-        drupal_set_message($message);
-      }
-    }
-  }
-}
-
-/**
  * Displays the file type admin overview page.
  */
 function file_entity_list_types_page() {
diff --git a/file_entity.module b/file_entity.module
index 7d3f252..b882734 100644
--- a/file_entity.module
+++ b/file_entity.module
@@ -664,13 +664,28 @@ function file_entity_file_operations() {
   $operations = array(
     'delete' => array(
       'label' => t('Delete selected files'),
-      'callback' => 'file_entity_multiple_delete_confirm',
+      'callback' => 'file_entity_multiple_delete_confirm_operation',
       'confirm' => TRUE,
     ),
   );
   return $operations;
 }
 
+
+/**
+ * File operation to show a confirm form for file deletion.
+ *
+ * @param array $files
+ *   An array of file_ids to delete.
+ * @return type
+ */
+function file_entity_multiple_delete_confirm_operation($files) {
+  // This function is a form generation function.
+  $form = array();
+  $form_state = array();
+  return file_entity_multiple_delete_confirm($form, $form_state, $files);
+}
+
 /**
  * Helper function to get a list of hidden stream wrappers.
  *
diff --git a/file_entity.pages.inc b/file_entity.pages.inc
index cd34364..01f93dd 100644
--- a/file_entity.pages.inc
+++ b/file_entity.pages.inc
@@ -94,8 +94,67 @@ function file_entity_page_delete($file) {
     return t('The file %title is in use and cannot be deleted.', array('%title' => $file->filename));
   }
   else {
-    $files = array($file->fid => $file);
-    return drupal_get_form('file_entity_multiple_delete_confirm', $files, '<front>', 'media/' . $file->fid);
+    $files = array($file->fid => $file->fid);
+    return drupal_get_form('file_entity_multiple_delete_confirm', $files);
+  }
+}
+
+/**
+ * Confirm form for the request to delete files.
+ *
+ * @param array $files
+ *   An array of file_ids to delete.
+ */
+function file_entity_multiple_delete_confirm($form, &$form_state, $files) {
+  $form = array();
+  $files = array_filter($files);
+
+  $form['files'] = array('#tree' => TRUE);
+  $form['file_titles'] = array('#theme' => 'item_list');
+
+  $files = file_load_multiple($files);
+  foreach ($files as $fid => $file) {
+    $form['files'][$fid] = array(
+      '#type' => 'value',
+      '#value' => $fid,
+    );
+    $form['file_titles']['#items'][] = check_plain($file->filename);
+  }
+  $form['operation'] = array('#type' => 'hidden', '#value' => 'delete');
+  $form['#submit'][] = 'file_entity_multiple_delete_confirm_submit';
+
+  $confirm_question = format_plural(count($files),
+                                  'Are you sure you want to delete this file?',
+                                  'Are you sure you want to delete these files?');
+
+  return confirm_form($form,
+    $confirm_question,
+    current_path(),
+    t('This action cannot be undone.'),
+    t('Delete'),
+    t('Cancel'));
+}
+
+/**
+ * Attempt to delete files and notify the user of the result.
+ */
+function file_entity_multiple_delete_confirm_submit($form, &$form_state) {
+  if ($form_state['values']['confirm']) {
+    $files = file_load_multiple(array_keys($form_state['values']['files']));
+    foreach ($files as $fid => $file) {
+      $result = file_delete($file);
+      if (is_array($result)) {
+        drupal_set_message(t('The file @title is in use and cannot be deleted.', array('@title' => $file->filename)), 'warning');
+      }
+      elseif (!$result) {
+        drupal_set_message(t('The file @title was not deleted due to an error.', array('@title' => $file->filename)), 'error');
+      }
+      else {
+        $message = t('File @title was deleted', array('@title' => $file->filename));
+        watchdog('file', $message);
+        drupal_set_message($message);
+      }
+    }
   }
 }
 
