diff --git a/privatemsg.module b/privatemsg.module
index 26db22b..c630ee4 100644
--- a/privatemsg.module
+++ b/privatemsg.module
@@ -569,17 +569,8 @@ function privatemsg_cron() {
     $query = _privatemsg_assemble_query('deleted', variable_get('privatemsg_flush_days', 30), variable_get('privatemsg_flush_max', 200));
 
     foreach ($query->execute()->fetchCol() as $mid) {
-      $message = privatemsg_message_load($mid);
-      module_invoke_all('privatemsg_message_flush', $message);
-
-      // Delete recipients of the message.
-      db_delete('pm_index')
-        ->condition('mid', $mid)
-        ->execute();
-      // Delete message itself.
-      db_delete('pm_message')
-        ->condition('mid', $mid)
-        ->execute();
+      // Delete each message
+      privatemsg_message_delete($mid);
     }
   }
 
@@ -1579,7 +1570,7 @@ function privatemsg_new_thread($recipients, $subject, $body = NULL, $options = a
 
   $validated = _privatemsg_validate_message($message);
   if ($validated['success']) {
-    $validated['message'] = _privatemsg_send($message);
+    $validated['message'] = privatemsg_message_save($message);
     if ($validated['message'] !== FALSE) {
       _privatemsg_handle_recipients($validated['message']->mid, $validated['message']->recipients, FALSE);
     }
@@ -1655,7 +1646,7 @@ function privatemsg_reply($thread_id, $body, $options = array()) {
   $message->subject = $first_message->subject;
   $validated = _privatemsg_validate_message($message);
   if ($validated['success']) {
-    $validated['message'] = _privatemsg_send($message);
+    $validated['message'] = privatemsg_message_save($message);
     if ($validated['message'] !== FALSE) {
       _privatemsg_handle_recipients($validated['message']->mid, $validated['message']->recipients, FALSE);
     }
@@ -1759,7 +1750,98 @@ function _privatemsg_validate_message(&$message, $form = FALSE) {
 }
 
 /**
- * Internal function to save a message.
+ * Returns a link to send message form for a specific users.
+ *
+ * Contains permission checks of author/recipient, blocking and
+ * if a anonymous user is involved.
+ *
+ * @param $recipient
+ *   Recipient of the message
+ * @param $account
+ *   Sender of the message, defaults to the current user
+ *
+ * @return
+ *   Either FALSE or a URL string
+ *
+ * @ingroup api
+ */
+function privatemsg_get_link($recipients, $account = array(), $subject = NULL) {
+  if ($account == NULL) {
+    global $user;
+    $account = $user;
+  }
+
+  if (!is_array($recipients)) {
+    $recipients = array($recipients);
+  }
+
+  if (!privatemsg_user_access('write privatemsg', $account) || $account->uid == 0) {
+    return FALSE;
+  }
+
+  $validated = array();
+  foreach ($recipients as $recipient) {
+    if (!privatemsg_user_access('read privatemsg', $recipient)) {
+      continue;
+    }
+    if (variable_get('privatemsg_display_link_self', TRUE) == FALSE && $account->uid == $recipient->uid) {
+      continue;
+    }
+    if (count(module_invoke_all('privatemsg_block_message', $account, array(privatemsg_recipient_key($recipient) => $recipient))) > 0) {
+      continue;
+    }
+    $validated[] = $recipient->uid;
+  }
+  if (empty($validated)) {
+    return FALSE;
+  }
+  $url = 'messages/new/' . implode(',', $validated);
+  if (!is_null($subject)) {
+    // Explicitly encode the / so that it will be encoded twice to work around
+    // the the menu_system.
+    $url .= '/' . str_replace('/', '%2F', $subject);
+  }
+  return $url;
+}
+
+/**
+ * Load a single message.
+ *
+ * @param $pmid
+ *   Message id, pm.mid field
+ * @param $account
+ *   For which account the message should be loaded.
+ *   Defaults to the current user.
+ *
+ * @ingroup api
+ */
+function privatemsg_message_load($pmid, $account = NULL) {
+  $conditions = array();
+  if ($account) {
+    $conditions['account'] = $account;
+  }
+  $messages = privatemsg_message_load_multiple(array($pmid), $conditions);
+  return current($messages);
+}
+
+/**
+ * Load multiple messages.
+ *
+ * @param $pmids
+ *   Array of Message ids, pm.mid field
+ * @param $account
+ *   For which account the message should be loaded.
+ *   Defaults to the current user.
+ *
+ * @ingroup api
+ */
+function privatemsg_message_load_multiple(array $pmids, array $conditions = array(), $reset = FALSE) {
+  $result = entity_load('privatemsg_message', $pmids, $conditions, $reset);
+  return $result;
+}
+
+/**
+ * Public API to save a message.
  *
  * @param $message
  *   A $message array with the data that should be saved. If a thread_id exists
@@ -1769,7 +1851,7 @@ function _privatemsg_validate_message(&$message, $form = FALSE) {
  * @return
  *   The updated $message array.
  */
-function _privatemsg_send($message) {
+function privatemsg_message_save($message) {
   $transaction = db_transaction();
   try {
     drupal_alter('privatemsg_message_presave', $message);
@@ -1851,96 +1933,24 @@ function _privatemsg_send($message) {
 }
 
 /**
- * Returns a link to send message form for a specific users.
+ * Delete a message, notifying any interested parties.
  *
- * Contains permission checks of author/recipient, blocking and
- * if a anonymous user is involved.
- *
- * @param $recipient
- *   Recipient of the message
- * @param $account
- *   Sender of the message, defaults to the current user
- *
- * @return
- *   Either FALSE or a URL string
- *
- * @ingroup api
- */
-function privatemsg_get_link($recipients, $account = array(), $subject = NULL) {
-  if ($account == NULL) {
-    global $user;
-    $account = $user;
-  }
-
-  if (!is_array($recipients)) {
-    $recipients = array($recipients);
-  }
-
-  if (!privatemsg_user_access('write privatemsg', $account) || $account->uid == 0) {
-    return FALSE;
-  }
-
-  $validated = array();
-  foreach ($recipients as $recipient) {
-    if (!privatemsg_user_access('read privatemsg', $recipient)) {
-      continue;
-    }
-    if (variable_get('privatemsg_display_link_self', TRUE) == FALSE && $account->uid == $recipient->uid) {
-      continue;
-    }
-    if (count(module_invoke_all('privatemsg_block_message', $account, array(privatemsg_recipient_key($recipient) => $recipient))) > 0) {
-      continue;
-    }
-    $validated[] = $recipient->uid;
-  }
-  if (empty($validated)) {
-    return FALSE;
-  }
-  $url = 'messages/new/' . implode(',', $validated);
-  if (!is_null($subject)) {
-    // Explicitly encode the / so that it will be encoded twice to work around
-    // the the menu_system.
-    $url .= '/' . str_replace('/', '%2F', $subject);
-  }
-  return $url;
-}
-
-/**
- * Load a single message.
- *
- * @param $pmid
- *   Message id, pm.mid field
- * @param $account
- *   For which account the message should be loaded.
- *   Defaults to the current user.
- *
- * @ingroup api
+ * @param $mid
+ *   Message ID.
  */
-function privatemsg_message_load($pmid, $account = NULL) {
-  $conditions = array();
-  if ($account) {
-    $conditions['account'] = $account;
-  }
-  $messages = privatemsg_message_load_multiple(array($pmid), $conditions);
-  return current($messages);
-}
+function privatemsg_message_delete($mid) {
+   $message = privatemsg_message_load($mid);
+   module_invoke_all('privatemsg_message_flush', $message);
 
-/**
- * Load multiple messages.
- *
- * @param $pmids
- *   Array of Message ids, pm.mid field
- * @param $account
- *   For which account the message should be loaded.
- *   Defaults to the current user.
- *
- * @ingroup api
- */
-function privatemsg_message_load_multiple(array $pmids, array $conditions = array(), $reset = FALSE) {
-  $result = entity_load('privatemsg_message', $pmids, $conditions, $reset);
-  return $result;
+  // Delete recipients of the message.
+  db_delete('pm_index')
+    ->condition('mid', $mid)
+    ->execute();
+  // Delete message itself.
+  db_delete('pm_message')
+    ->condition('mid', $mid)
+    ->execute();
 }
-
 /**
  * Generates a query based on a query id.
  *
diff --git a/privatemsg.pages.inc b/privatemsg.pages.inc
index 63ddaf4..d6e3a69 100644
--- a/privatemsg.pages.inc
+++ b/privatemsg.pages.inc
@@ -620,7 +620,7 @@ function privatemsg_new_submit($form, &$form_state) {
     $recipient_names[] = privatemsg_recipient_format($recipient);
   }
   try {
-    $message = _privatemsg_send($message);
+    $message = privatemsg_message_save($message);
     _privatemsg_handle_recipients($message->mid, $message->recipients);
     drupal_set_message(t('A message has been sent to !recipients.', array('!recipients' => implode(', ', $recipient_names))));
     // Only redirect on new threads.
