diff --git a/CHANGELOG.txt b/CHANGELOG.txt
deleted file mode 100644
index 9a763b2..0000000
--- a/CHANGELOG.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Webform Remote Post 7.x-1.1
----------------------------
-#2038071 by that0n3guy, enrique.delgado: Adding functionality to be able to send JSON (selectable)
\ No newline at end of file
diff --git a/README.txt b/README.txt
index ddb6f20..e557ab8 100644
--- a/README.txt
+++ b/README.txt
@@ -1,12 +1,12 @@
 
 -- SUMMARY --
 
-Webform Remote Post is a module that works along the Webform module. It eases
-the integration between Webforms and other web applications by extending the
-out-of-the-box functionality if the Webform module.
+Webform Remote Post works along with the Webform module to ease the integration
+between Webforms and other web applications by extending the out-of-the-box
+functionality if the Webform module.
 
 Webform Remote Post works by POSTing form submissions to any arbitrary URL,
-presumably, an application or script that will use the form data and perform
+presumably an application or script that will use the form data and perform
 further processing of it. It respects the form's validation and will only send
 submissions that passed validation and are no longer in a draft state. Multiple
 remote posts can be setup for each individual form, allowing for the submission
@@ -16,7 +16,7 @@ of data to multiple systems at once.
 
 Webform module: http://drupal.org/project/webform
 
-The module was developed against the 7.x-3.18 version fo Webform, but it should
+The module was developed against the 6.x-3.19 version fo Webform, but it should
 work with previous versions as long as they include the
 hook_webform_submission_insert() hook definition.
 
@@ -24,23 +24,21 @@ hook_webform_submission_insert() hook definition.
 -- INSTALLATION --
 
 * Install as usual, see
-  http://drupal.org/documentation/install/modules-themes/modules-7 for further
-  information.
+  https://drupal.org/documentation/install/modules-themes/modules-5-6.
 
 
 -- CONFIGURATION --
 
-* Configure user permissions in Administration » People » Permissions:
+* Configure user permissions in Administer » Permissions:
 
-  - Admin webform remote posts
+  - admin webform remote posts
 
-    Users in roles with the "Display drupal links" permission will be able
-    to see the "Remote Posts" edit section of a webform. Here, they can
-    add more targets, remove them or disable them.
+    Users in roles with the "admin webform remote posts" permission will be able
+    to view the "Remote Posts" page of a webform where they can add, remove, and
+    disable remote post targets.
 
-  Note that the sending of data to remote targets is not affected by this
-  permission. In fact, if your form is accessible to anonymous users,
-  filling out the form and submitting it will trigger the remote form
+  Note that sending data to remote targets is not affected by this permission.
+  Submitting a valid form is sufficient to trigger the remote form
   submission.
 
 * Customize the remote posts settings on on a per-webform basis:
diff --git a/includes/webform_remote_post.target.inc b/includes/webform_remote_post.target.inc
deleted file mode 100644
index fda87bf..0000000
--- a/includes/webform_remote_post.target.inc
+++ /dev/null
@@ -1,143 +0,0 @@
-<?php
-
-/**
- * @file
- * Webform Remote Post URL single target edit page.
- */
-
-/**
- * Form for configuring an individual remote post target settings.
- * @param array $form
- * @param array $form_state
- * @param array $webform_node An array representing a webform node.
- * @param integer $target A webform remote post target.
- */
-function webform_remote_post_target_edit_form($form, &$form_state, $webform_node, $target = array()){
-
-  #drupal_set_message('In ' . __FILE__ . ' line ' . __LINE__ . ', form is: ' . print_r($form, true));
-  $form['#tree'] = TRUE;
-  $form['#node'] = $webform_node;
-
-  #drupal_set_message(print_r($target, true));
-  // Internal to the form and never displayed to the screen.
-  $form['nid'] = array(
-    '#type' => 'value',
-    '#value' => $webform_node->nid,
-  );
-
-  if (isset($target['tid'])) {
-    $form['tid'] = array(
-      '#type' => 'value',
-      '#value' => $target['tid'],
-    );
-  }
-
-  // Form elements for a remote post target settings. Actually rendered by
-  // the theme_webform_remote_post_target_edit_form function below.
-  $form['edit']['label'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Label'),
-    '#description' => t('The name of the remote system as displayed in the table above. E.g. "My CRM system"'),
-    '#size' => 20,
-    '#maxlength' => 60,
-    '#required' => FALSE,
-    '#value' => $target['label'],
-  );
-
-  $form['edit']['url'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Target URL'),
-    '#description' => t('The full URL to POST to. E.g. http://www.mycrm.com/form_handler.php'),
-    '#size' => 100,
-    '#maxlength' => 500,
-    '#required' => TRUE,
-    '#value' => $target['url'],
-  );
-
-  $form['edit']['type'] = array(
-    '#type' => 'select',
-    '#title' => t('Post Type'),
-    '#options' => array(
-      'x-www-form-urlencoded' => t('x-www-form-urlencoded'),
-      'json' => t('JSON'),
-    ),
-    '#default_value' => 'x-www-form-urlencoded',
-    #'#value' => $target['type'],
-    #'#value' => 'json',
-    '#description' => t('Use x-www-form-urlencoded if unsure, as it is the default format for HTML forms. You also have the option to post data in <a href="http://www.json.org/" target="_blank">JSON</a> format.'),
-    '#required' => TRUE,
-  );
-  if (isset($target['type'])) {
-    $form['edit']['type']['#value'] = $target['type'];
-  }
-
-  // Add the submit button.
-  $form['submit'] = array(
-    '#type' => 'submit',
-    '#value' => t('Save remote post settings'),
-    '#weight' => 20,
-  );
-  #drupal_set_message('In ' . __FILE__ . ' line ' . __LINE__ . ', form is: ' . print_r($form, true));
-  return $form;
-}
-
-/**
- * Theme the remote post settings section of the node form.
- * @param array $variables
- *   An array representing the form, with these keys:
- *   - form: the form array.
- *
- * @return array
- *   Formatted HTML form, ready for display.
- */
-function theme_webform_remote_post_target_edit_form($variables) {
-  $form = $variables['form'];
-  $children = element_children($form, TRUE);
-  return drupal_render_children($form, $children);
-}
-
-/**
- * Submit handler for webform_remote_post_target_edit_form().
-*/
-function webform_remote_post_target_edit_form_submit($form, &$form_state) {
-  $target = array();
-
-  #drupal_set_message('In ' . __FILE__ . ' line ' . __LINE__ . ', $form_state is: ' . print_r($form_state, true));
-
-  // Optional fields:
-  if (!empty($form_state['input']['edit']['label'])) {
-    $target['label'] = trim($form_state['input']['edit']['label']);
-  }
-
-  // Required fields:
-  $target['url']  = trim($form_state['input']['edit']['url']);
-  $target['type'] = trim($form_state['input']['edit']['type']);
-  $target['nid']  = trim($form_state['values']['nid']);
-
-  if (!isset($form_state['values']['tid'])) {
-    // TODO: Like in webform, this is not race-condition safe.
-    // Switch to using transactions as well?
-    $next_id_query = db_select('webform_remote_post_targets')->condition('nid', $target['nid']);
-    $next_id_query->addExpression('MAX(tid) + 1', 'tid');
-    $next_id = $next_id_query->execute()->fetchField();
-    if ($next_id == NULL) {
-      $target['tid'] = 1;
-    } else {
-      $target['tid'] = $next_id;
-    }
-    $success = drupal_write_record('webform_remote_post_targets', $target);
-  } else {
-    $target['tid'] = trim($form_state['values']['tid']);
-    #drupal_set_message('In ' . __FILE__ . ' line ' . __LINE__ . ', $target is: ' . print_r($target, true));
-    $success = drupal_write_record('webform_remote_post_targets', $target, array('nid', 'tid'));
-  }
-
-  #drupal_set_message('In ' . __FILE__ . ' line ' . __LINE__ . ', $success is: ' . print_r($success, true));
-
-  // Write a log if we weren't able to save the target successfully.
-  if ($success === FALSE) {
-    watchdog('webform_remote_post', 'There was an error writing a new remote post target to the database.', array(), WATCHDOG_ERROR);
-  }
-
-  $form_state['redirect'] = 'node/' . $form['#node']->nid . '/webform/targets/';
-}
diff --git a/includes/webform_remote_post.targets.inc b/includes/webform_remote_post.targets.inc
index 77848e3..c566665 100644
--- a/includes/webform_remote_post.targets.inc
+++ b/includes/webform_remote_post.targets.inc
@@ -6,60 +6,53 @@
  */
 
 /**
- * An overview of the URL repost targets associated with a given form.
+ * List remote post targets associated with a given webform.
  */
-function webform_remote_post_targets_form($form, &$form_state, $webform_node) {
+function webform_remote_post_targets_form($form_state, $node) {
+  // Adds the node object to the $form array.
+  $form['#node'] = $node;
 
-  $form['#tree'] = TRUE;
-  $form['#node'] = $webform_node;
-
-  // Internal to the form and never displayed to the screen.
+  // Adds the webform Node ID to the form.
   $form['nid'] = array(
     '#type' => 'value',
-    '#value' => $webform_node->nid,
+    '#value' => $node->nid,
   );
 
-  $targets = array();
+  // Retrieves the associated remote post targets from the database.
+  $query = db_query('SELECT * FROM {webform_remote_post_targets} WHERE nid = %d', $node->nid);
 
-  $targets = db_select('webform_remote_post_targets')
-    ->fields('webform_remote_post_targets')
-    ->condition('nid', $webform_node->nid)
-    ->execute()
-    ->fetchAllAssoc('tid', PDO::FETCH_ASSOC);
+  // Constructs an array of associated remote post targets indexed by Target ID.
+  $targets = array();
+  while ($target = db_fetch_array($query)) {
+    $targets[$target['tid']] = $target;
+  }
 
+  // Constructs a form from the array of associated remote post targets.
   foreach ($targets as $tid => $data) {
+    $status = ($data['enabled'] ? t('Enabled') : t('Disabled'));
     $form['targets'][$tid]['status'] = array(
-      '#type' => 'checkbox',
-      '#default_value' => $data['enabled'],
-      '#ajax' => array(
-        'callback' => 'webform_remote_post_update_enabled_flag',
-        'wrapper' => 'enabled_flag_' . $tid,
-      ),
-      '#prefix' => '<div id="enabled_flag_' . $tid . '">',
-      '#suffix' => '</div>',
+      '#value' => check_plain($status),
     );
     $form['targets'][$tid]['label'] = array(
-      '#markup' => check_plain($data['label']),
+      '#value' => check_plain($data['label']),
     );
     $form['targets'][$tid]['url'] = array(
-      '#markup' => check_plain($data['url']),
+      '#value' => check_plain($data['url']),
     );
-   $form['targets'][$tid]['type'] = array(
-      '#markup' => check_plain($data['type']),
+    $form['targets'][$tid]['type'] = array(
+      '#value' => check_plain($data['type']),
     );
   }
 
-  // Form elements for a new remote post target. Actually rendered by
-  // the theme_webform_remote_post_targets_form function below.
+  // Constructs a form for adding a new remote post target.
   $form['add']['label'] = array(
     '#type' => 'textfield',
     '#title' => t('Label'),
     '#description' => t('The name of the remote system as displayed in the table above. E.g. "My CRM system"'),
     '#size' => 20,
     '#maxlength' => 60,
-    '#required' => FALSE,
+    '#required' => TRUE,
   );
-
   $form['add']['url'] = array(
     '#type' => 'textfield',
     '#title' => t('Target URL'),
@@ -68,54 +61,58 @@ function webform_remote_post_targets_form($form, &$form_state, $webform_node) {
     '#maxlength' => 500,
     '#required' => TRUE,
   );
-//  $form['add']['type'] = array(
-//    '#type' => 'select',
-//    '#title' => t('Post Type'),
-//    '#options' => array(
-//       'x-www-form-urlencoded' => t('x-www-form-urlencoded'),
-//       'json' => t('JSON'),
-//    ),
-//    '#default_value' => 'x-www-form-urlencoded',
-//    '#description' => t('Use x-www-form-urlencoded if unsure, as it is the default format for HTML forms. You also have the option to post data in <a href="http://www.json.org/" target="_blank">JSON</a> format.'),
-//    '#required' => TRUE,
-//  );
-  $form['add_button'] = array(
+  $form['add']['type'] = array(
+    '#type' => 'select',
+    '#title' => t('Post Type'),
+    '#options' => array(
+      'x-www-form-urlencoded' => t('x-www-form-urlencoded'),
+      'json' => t('JSON'),
+    ),
+    '#default_value' => 'x-www-form-urlencoded',
+    '#description' => t('Use x-www-form-urlencoded if unsure, as it is the default format for HTML forms. You also have the option to post data in <a href="@url" target="_blank">JSON</a> format.', array('@url' => url('http://www.json.org/', array('external' => TRUE)))),
+    '#required' => TRUE,
+  );
+  $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Add'),
     '#weight' => 45,
   );
 
-  $form['#validate'] = array('webform_remote_post_target_validate');
-
   return $form;
 }
 
 /**
  * Theme the node components form. Use a table to organize the components.
  *
- * @param array $variables
- *   An array representing the form, with these keys:
- *   - form: the form array.
+ * @param array $form
+ *   An array representing the form.
  *
  * @return array
  *   Formatted HTML form, ready for display.
  */
-function theme_webform_remote_post_targets_form($variables) {
-  $form = $variables['form'];
-  $webform_node = $form['#node'];
-  $header = array(t('Enabled'), t('Label'), t('Target URL'), t('Post Type'), array('data' => t('Operations'), 'colspan' => 2));
-  $rows = array();
+function theme_webform_remote_post_targets_form($form) {
+  // Constructs an array of table header values.
+  $header = array(
+    t('Status'),
+    t('Label'),
+    t('Target URL'),
+    t('Post Type'),
+    t('Operations'),
+  );
 
+  // Constructs an array of table row values.
+  $rows = array();
   if (!empty($form['targets'])) {
     foreach (element_children($form['targets']) as $tid) {
-      // Add each target to a table row.
+      // Adds each remote post target to a table row.
+      $update = ($form['targets'][$tid]['status']['#value'] == 'Enabled' ? t('Disable') : t('Enable'));
       $rows[] = array(
         drupal_render($form['targets'][$tid]['status']),
         drupal_render($form['targets'][$tid]['label']),
         drupal_render($form['targets'][$tid]['url']),
         drupal_render($form['targets'][$tid]['type']),
-        l(t('Edit'), 'node/' . $webform_node->nid . '/webform/targets/' . $tid),
-        l(t('Delete'), 'node/' . $webform_node->nid . '/webform/targets/' . $tid . '/delete'),
+        l($update, 'node/' . $form['#node']->nid . '/webform/targets/' . $tid . '/' . strtolower($update)),
+        l(t('Delete'), 'node/' . $form['#node']->nid . '/webform/targets/' . $tid . '/delete'),
       );
     }
   }
@@ -123,106 +120,120 @@ function theme_webform_remote_post_targets_form($variables) {
     $rows[] = array(array('data' => t('No remote target URLs specified yet. Add a target URL below.'), 'colspan' => 6));
   }
 
-  // Add a row containing form elements for a new item.
+  // Adds a row containing form elements for a new remote post target.
   $row_data = array(
     array('colspan' => 5, 'data' => drupal_render($form['add'])),
     array('colspan' => 1, 'data' => drupal_render($form['add_button'])),
   );
   $rows[] = array('data' => $row_data, 'class' => array('webform-remote-post-add-target-form'));
 
-  $output = '';
-  $output .= theme('table', array(
-    'header' => $header,
-    'rows' => $rows,
-    'attributes' => array('id' => 'webform-remote-post-targets')));
-  $output .= drupal_render_children($form);
+  $output = theme('table', $header, $rows);
+
+  foreach (element_children($form) as $key) {
+    if (!empty($form[$key])) {
+      $output .= drupal_render($form[$key]);
+    }
+  }
+
   return $output;
 }
 
 /**
- * Validate handler for webform_remote_post_targets_form().
+ * Validation handler for webform_remote_post_targets_form().
  */
-function webform_remote_post_target_validate($form, &$form_state) {
-  if (!valid_url($form_state['values']['add']['url'])) {
-    $url = trim($form_state['values']['add']['url']);
-    form_set_error('url', t('The entered URL "@url" does not appear valid.', array('@url' => $url)));
+function webform_remote_post_targets_form_validate($form, &$form_state) {
+  if (!valid_url(trim($form_state['values']['url']))) {
+    $url = trim($form_state['values']['url']);
+    form_set_error('url', t('The supplied URL "@url" does not appear valid.', array('@url' => $url)));
   }
 }
 
 /**
- * Submit handler for webform_remote_post_forwards_form().
+ * Submission handler for webform_remote_post_forwards_form().
  */
 function webform_remote_post_targets_form_submit($form, &$form_state) {
-  // We are creating a new post target. Lets pass the data to the
-  // individual remote post target edit settings form. Only the basic
-  // fields are shown here. All advanced settings happen in the individual
-  // remote post target settings form.
-  $form_state['redirect'] = array('node/' . $form['#node']->nid . '/webform/targets/new', array('query' => array('url' => $form_state['values']['add']['url'], 'label' => $form_state['values']['add']['label'])));
-}
-
-/**
- * Submit handler for webform_remote_post_target_delete_form().
- */
-function webform_remote_post_target_delete_form_submit($form, &$form_state, $webform_mode, $target_id) {
-
-  // Delete the target entry.
-  db_delete('webform_remote_post_targets')
-    ->condition('nid', $webform_mode->nid)
-    ->condition('tid', $target_id)
-    ->execute();
-
-  drupal_set_message(t('Remote post target deleted.'));
-  drupal_goto('node/' . $webform_mode->nid . '/webform/targets');
+  // Constructs the remote post target object.
+  $target = new stdClass();
+  $target->nid = trim($form_state['values']['nid']);
+  $target->url = trim($form_state['values']['url']);
+  $target->label = trim($form_state['values']['label']);
+  $target->type = trim($form_state['values']['type']);
+
+  // Writes the remote post target object to the database.
+  $success = drupal_write_record('webform_remote_post_targets', $target);
+
+  // Logs unsuccessful updates.
+  if ($success === FALSE) {
+    watchdog('webform_remote_post', 'There was an error writing a new remote post target to the database.', array(), WATCHDOG_ERROR);
+    drupal_set_message(t('The remote post target could not be created.'), 'error');
+  }
+  else {
+    drupal_set_message(t('The remote post target was successfully created.'));
+  }
 }
 
 /**
- * Callback for target enabled flag.
+ * Page callback for enabling and disabling remote post targets.
  *
- * @return array
- *   The textfield element renderable array
+ * @param array $form_state
+ *   A keyed array containing the current state of the form.
+ *
+ * @param object $node
+ *   The node object passed by webform_menu_load().
+ *
+ * @param int $tid
+ *   The Target ID passed into the URL.
+ *
+ * @param string $flag
+ *   The requested state passed into the URL.
  */
-function webform_remote_post_update_enabled_flag($form, $form_state) {
-  // The form has already been submitted and updated. We can return the replaced
-  // item as it is.
-  // Looks like we can use $form_state['triggering_element'] to tell which
-  // target to change:
-  // $form_state['triggering_element']['value'] has the new value to set.
-  // $form_state['values']['nid'] has the webform ID to chage.
-  // What's the best place to get the target ID from? Best guess right now
-  // is $form_state['triggering_element']['array_parents'][1] :-/
-  $target_id = $form_state['triggering_element']['#array_parents'][1];
-
-  // Update the remote post target:
-  db_update('webform_remote_post_targets')
-    ->fields(array(
-      'enabled' => $form_state['triggering_element']['#value'],
-    ))
-    ->condition('nid', $form_state['values']['nid'])
-    ->condition('tid', $target_id)
-    ->execute();
-
-  return $form['targets'][$target_id]['status'];
+function webform_remote_post_targets_update($form_state, $node, $tid, $flag) {
+  // Converts $flag to an integer representing the requested state.
+  $flag = ($flag == 'enable' ? 1 : 0);
+
+  // Constructs the remote post target object.
+  $target = new stdClass();
+  $target->nid = $node->nid;
+  $target->tid = $tid;
+  $target->enabled = $flag;
+
+  // Updates the remote post target's database record.
+  $success = drupal_write_record('webform_remote_post_targets', $target, array('nid', 'tid'));
+
+  // Logs unsuccessful updates.
+  if ($success === FALSE) {
+    watchdog('webform_remote_post', 'There was an error updating a remote post target.', array(), WATCHDOG_ERROR);
+    drupal_set_message(t('The remote post target could not be updated.'), 'error');
+  }
+  else {
+    drupal_set_message(t('The remote post target was successfully updated.'));
+    drupal_goto('node/' . $node->nid . '/webform/targets');
+  }
 }
 
 /**
- * Load a remote target setting from the database or initialize a new remote target.
+ * Page callback for deleting remote post targets.
+ *
+ * @param array $form_state
+ *   A keyed array containing the current state of the form.
+ *
+ * @param object $node
+ *   The node object passed by webform_menu_load().
+ *
+ * @param int $tid
+ *   The Target ID passed into the URL.
  */
-function webform_remote_post_target_load($tid, $nid) {
-
-  if ($tid == 'new') {
-    $target = array();
-    if (isset($_GET['label']) && isset($_GET['url'])) {
-      $target['label'] = $_GET['label'];
-      $target['url']   = $_GET['url'];
-    }
-  } else {
-    $target = db_select('webform_remote_post_targets')
-      ->fields('webform_remote_post_targets', array('nid', 'tid', 'url', 'label', 'enabled', 'type'))
-      ->condition('nid', $nid)
-      ->condition('tid', $tid)
-      ->execute()
-      ->fetchAssoc('tid', PDO::FETCH_ASSOC);
+function webform_remote_post_targets_delete($form_state, $node, $tid) {
+  // Deletes the remote post target's database record.
+  $success = db_query('DELETE FROM {webform_remote_post_targets} WHERE nid = %d AND tid = %d', $node->nid, $tid);
+
+  // Logs unsuccessful updates.
+  if ($success === FALSE) {
+    watchdog('webform_remote_post', 'There was an error deleting a remote post target.', array(), WATCHDOG_ERROR);
+    drupal_set_message(t('The remote post target could not be deleted.'), 'error');
+  }
+  else {
+    drupal_set_message(t('The remote post target was successfully deleted.'));
+    drupal_goto('node/' . $node->nid . '/webform/targets');
   }
-  #drupal_set_message(print_r($target, true));
-  return $target;
 }
diff --git a/webform_remote_post.info b/webform_remote_post.info
index f401201..d426ee5 100644
--- a/webform_remote_post.info
+++ b/webform_remote_post.info
@@ -1,5 +1,5 @@
 name = Webform Remote Post
-description = Post webform data (form submissions) to any arbitrary URL, presumably, an application or script that will use the form data and perform further processing with it.
-core = 7.x
+description = Post webform data (form submissions) to any arbitrary URL, presumably an application or script that will use the form data and perform further processing with it.
+core = 6.x
 dependencies[] = webform
-package = Webform
\ No newline at end of file
+package = Webform
diff --git a/webform_remote_post.install b/webform_remote_post.install
index 66e7abb..e4bc3f4 100644
--- a/webform_remote_post.install
+++ b/webform_remote_post.install
@@ -23,11 +23,7 @@ function webform_remote_post_schema() {
       ),
       'tid' => array(
         'description' => 'The URL target identifier.',
-        'type' => 'int',
-        'unsigned' => TRUE,
-        'size' => 'small',
-        'not null' => TRUE,
-        'default' => 0,
+        'type' => 'serial',
       ),
       'url' => array(
         'description' => 'The http address that will be used to post upon submission.',
@@ -50,24 +46,30 @@ function webform_remote_post_schema() {
         'description' => 'The type of content to send remotely.',
         'type' => 'text',
         'not null' => FALSE,
-      ),      
+      ),
     ),
     'primary key' => array('nid', 'tid'),
+    'indexes' => array(
+      'nid' => array('nid'),
+      'tid' => array('tid'),
+      'nid_tid' => array('nid',' tid'),
+    ),
   );
 
   return $schema;
 }
 
-
+/**
+ * Implements hook_install().
+ */
+function webform_remote_post_install() {
+  drupal_install_schema('webform_remote_post');
+}
 
 /**
- * First update for the post type
+ * Implements hook_uninstall().
  */
-function webform_remote_post_update_7100(&$sandbox) {
-  $new_field = array(
-    'description' => 'The type of content to send remotely.',
-    'type' => 'text',
-    'not null' => FALSE,
-  );    
-  db_add_field('webform_remote_post_targets', 'type', $new_field);
+function webform_remote_post_uninstall() {
+  // Drop tables.
+  drupal_uninstall_schema('webform_remote_post');
 }
diff --git a/webform_remote_post.module b/webform_remote_post.module
index e00fbb2..4708004 100644
--- a/webform_remote_post.module
+++ b/webform_remote_post.module
@@ -11,8 +11,6 @@
 
 /**
  * Implements hook_help().
- *
- * Displays help and module information.
  */
 function webform_remote_post_help($path, $arg) {
   switch ($path) {
@@ -20,32 +18,36 @@ function webform_remote_post_help($path, $arg) {
       $output = '';
       $output .= '<h3>' . t('About') . '</h3>';
       $output .= '<p>' . t('Webform Remote Post is a module that works along
-                            the Webform module. It eases the integration
+                            with the Webform module. It eases the integration
                             between Webforms and other web applications like
                             Salesforce and Eloqua.') . '</p>';
       $output .= '<p>' . t('Webform Remote Post works by POSTing form
-                            submissions to any arbitrary URL, presumably,
+                            submissions to any arbitrary URL, presumably
                             an application or script that will use the form
                             data and perform further processing of it. It
                             respects the form\'s validation and will only
                             send submissions that passed validation and
                             are no longer in a draft state. Multiple
-                            remote posts can be setup for each individual
+                            remote posts can be set up for each individual
                             form, allowing for the submission of data
                             to multiple systems at once.') . '</p>';
+      $output .= '<p>' . t('Webform Remote Post will attempt POSTing until
+                            sucessful three times before failing, and each
+                            attempt is configured to timeout after 15 seconds.')
+                            . '</p>';
       $output .= '<h3>' . t('Use Cases') . '</h3>';
       $output .= '<ul>';
       $output .= '<li>' . t('CRM Integration &ndash; If you have a CRM like
-                             Salesforce, you can use this module to push
+                             Salesforce you can use this module to push
                              submissions using the web-to-lead mechanism to
                              create a Lead from every Webform submission in
                              your Drupal site.') . '</li>';
       $output .= '<li>' . t('Eloqua Integration &ndash; Create lead forms
                              to be submitted to Eloqua. Add the hidden fields
                              as indicated in Eloqua and it\'s ready to go.') . '</li>';
-      $output .= '<li>' . t('Re-posting to any 3rd party system &ndash; This
-                             module is general purpose. You need the form data
-                             to be immediately submitted to another system
+      $output .= '<li>' . t('Re-posting to any 3rd party system &ndash; This is
+                             a general-purpose module . Do you need the form
+                             data to be immediately submitted to another system
                              automatically? Add a remote post target to it!') . '</li>';
       $output .= '</ul>';
       return $output;
@@ -60,11 +62,9 @@ function webform_remote_post_help($path, $arg) {
 function webform_remote_post_menu() {
   $items = array();
 
-  // Targets list, %webform_menu is an auto-loader wildcard component
-  // provided by the webform module (method is webform_menu_load), and it
-  // auto-loads a webform node.
+  // Lists remote post targets associated with a given webform.
   $items['node/%webform_menu/webform/targets'] = array(
-    'title' => 'Remote Posts',
+    'title' => 'Remote Post Targets',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('webform_remote_post_targets_form', 1),
     'access callback' => 'user_access',
@@ -73,26 +73,34 @@ function webform_remote_post_menu() {
     'weight' => 1,
     'type' => MENU_LOCAL_TASK,
   );
-  // Edit or create a target.
-  $items['node/%webform_menu/webform/targets/%webform_remote_post_menu_target'] = array(
-    'title' => 'Edit remote post settings',
+  // Enables a remote post target.
+  $items['node/%webform_menu/webform/targets/%/enable'] = array(
+    'title' => 'Update Remote Post Target',
+    'load arguments' => array(1),
+    'page arguments' => array(
+      'webform_remote_post_targets_update', 1, 4, 'enable'),
+    'access callback' => 'user_access',
+    'access arguments' => array('admin webform remote posts'),
+    'type' => MENU_CALLBACK,
+  );
+  // Disables a remote post target.
+  $items['node/%webform_menu/webform/targets/%/disable'] = array(
+    'title' => 'Update Remote Post Target',
     'load arguments' => array(1),
     'page arguments' => array(
-      'webform_remote_post_target_edit_form', 1, 4),
+      'webform_remote_post_targets_update', 1, 4, 'disable'),
     'access callback' => 'user_access',
     'access arguments' => array('admin webform remote posts'),
-    'file' => 'includes/webform_remote_post.target.inc',
     'type' => MENU_CALLBACK,
   );
-  // Delete a target.
+  // Deletes a remote post target.
   $items['node/%webform_menu/webform/targets/%/delete'] = array(
-    'title' => 'Delete repost target',
+    'title' => 'Delete remote post target',
     'load arguments' => array(1),
     'page arguments' => array(
-      'webform_remote_post_target_delete_form_submit', 1, 4),
+      'webform_remote_post_targets_delete', 1, 4),
     'access callback' => 'user_access',
     'access arguments' => array('admin webform remote posts'),
-    'file' => 'includes/webform_remote_post.targets.inc',
     'type' => MENU_CALLBACK,
   );
   return $items;
@@ -113,70 +121,53 @@ function webform_remote_post_menu() {
  * @todo Support of File component.
  */
 function webform_remote_post_webform_submission_insert($node, $submission) {
-  // Skip draft forms:
+  // Skips forms in draft.
   if ($submission->is_draft) {
     return;
   }
 
-  // Get this webform node remote targets from the DB:
+  // Retrieves the associated remote post targets from the database.
+  $query = db_query('SELECT * FROM {webform_remote_post_targets} WHERE nid = %d AND enabled = 1', $node->nid);
+
   $targets = array();
-  $targets = db_select('webform_remote_post_targets')
-    ->fields('webform_remote_post_targets')
-    ->condition('nid', $node->nid)
-    ->condition('enabled', 1)
-    ->execute()
-    ->fetchAllAssoc('tid', PDO::FETCH_ASSOC);
-
-  // Create a map with webform component ID's and the component themselves,
-  // handy later on.
+
+  while ($target = db_fetch_array($query)) {
+    $targets[$target['tid']] = $target;
+  }
+
+  // Creates an array of webform components and component IDs.
   $component_map = array();
   foreach ($node->webform['components'] as $component) {
     $component_map[$component['cid']] = $component;
   }
 
-  // Prepare the submission data for remote posting. Creating a two-dimensional
-  // array of form field names and the data.
+  // Prepares the submission data for remote posting.
   $payload = array();
   foreach ($submission->data as $cid => $component_data) {
-    $payload[$component_map[$cid]['form_key']] = implode(', ', $component_data);
+    $payload[$component_map[$cid]['form_key']] = implode(', ', $component_data['value']);
   }
 
-  // Acceptable server response codes.
-  $benign_reponse_codes = array('200', '301', '302', '307');
+  // Lists acceptable server response codes.
+  $benign_reponse_codes = array('200', '201', '202', '204', '301', '302', '307');
 
-  // Repost data to each target.
+  // Posts submission data to each remote post target.
   foreach ($targets as $tid => $target) {
 
-    if($target['type'] == 'json'){
-      // JSON Encode the payload.
+    if ($target['type'] == 'json') {
       $post_data = json_encode($payload);
-    
-      // Repost data to each target. Begin by setting the
-      // options for drupal_http_request().
-      $drupal_http_request_options = array(
-        'method' => 'POST',
-        'data' => $post_data,
-        'timeout' => 15,
-        'headers' => array('Content-Type' => 'application/json', 'Accept' => '*/*'),
+      $headers = array(
+        'Content-Type' => 'application/json',
+        'Accept' => '*/*',
       );
     }
     else {
-      // URL-encode the payload.
-      $post_data = http_build_query($payload);
-    
-      // Repost data to each target. Begin by setting the
-      // options for drupal_http_request().
-      $drupal_http_request_options = array(
-        'method' => 'POST',
-        'data' => $post_data,
-        'timeout' => 15,
-        'headers' => array('Content-Type' => 'application/x-www-form-urlencoded'),
-      );
+      $post_data = http_build_query($payload, '', '&');
+      $headers = array('Content-Type' => 'application/x-www-form-urlencoded');
     }
 
-    // Where the magic happens:
-    $request = drupal_http_request($target['url'], $drupal_http_request_options);
-    // Log any errors.
+    $request = drupal_http_request($target['url'], $headers, 'POST', $post_data, 3, 15);
+
+    // Logs errors.
     if (isset($request->code) && !in_array($request->code, $benign_reponse_codes)) {
       $log_msg = 'A remote (%type) post to %url by webform node ID %id returned a ';
       $log_msg .= '\'%code\' code, which is a different HTTP response code ';
@@ -200,12 +191,9 @@ function webform_remote_post_webform_submission_insert($node, $submission) {
 /**
  * Implements hook_perm().
  */
-function webform_remote_post_permission() {
+function webform_remote_post_perm() {
   return array(
-    'admin webform remote posts' => array(
-      'title' => t('Admin webform remote posts'),
-      'description' => t('Grants access to the "Remote Posts" webform settings on all webform content.'),
-    ),
+    'admin webform remote posts',
   );
 }
 
@@ -216,20 +204,9 @@ function webform_remote_post_theme($existing, $type, $theme, $path) {
   $theme = array(
     // webform_remote_posts.targets.inc.
     'webform_remote_post_targets_form' => array(
-      'render element' => 'form',
+      'arguments' => array('form' => NULL),
       'file' => 'includes/webform_remote_post.targets.inc',
     ),
   );
   return $theme;
 };
-
-/**
- * Menu loader callback. Load a remote post target if the given tid is a valid.
- */
-function webform_remote_post_menu_target_load($tid, $nid) {
-  module_load_include('inc', 'webform_remote_post', 'includes/webform_remote_post.targets');
-  $target = webform_remote_post_target_load($tid, $nid);
-  watchdog('webform_remote_post',"The target id to load is $tid");
-  watchdog('webform_remote_post','The auto-loaded target is ' . print_r($target, true));
-  return $target;
-}
