diff --git a/wf_jenkins/wf_jenkins.drush.inc b/wf_jenkins/wf_jenkins.drush.inc
index 6c24a3b..72b03f8 100644
--- a/wf_jenkins/wf_jenkins.drush.inc
+++ b/wf_jenkins/wf_jenkins.drush.inc
@@ -1,7 +1,7 @@
 <?php
 /**
  * @file
- *  Drush command for Workflow Jenkins
+ * Drush command for Workflow Jenkins
  */
 
 /**
@@ -9,7 +9,7 @@
  */
 function wf_jenkins_drush_command() {
   $items = array();
-  
+
   $items['jenkins-updated-code'] = array(
     'description' => dt('Informs Drupal that Jenkins has updated the code for a given job'),
     'examples' => array(
diff --git a/wf_jenkins/wf_jenkins.module b/wf_jenkins/wf_jenkins.module
index 0530172..7298c55 100644
--- a/wf_jenkins/wf_jenkins.module
+++ b/wf_jenkins/wf_jenkins.module
@@ -5,55 +5,9 @@
  */
 
 /**
- * Implements hook_menu().
+ * The Action function for 'wf_jenkins_update_code_submit'.
  */
-function wf_jenkins_menu() {
-  $items = array();
-
-  $items['job/%wf_job/update-code'] = array(
-    'title' => t('Update code'),
-    'access arguments' => array('update job sandbox code'),
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('wf_jenkins_update_job_code_form', 1),
-    'type' => MENU_LOCAL_TASK,
-  );
-
-  return $items;
-}
-
-/**
- * Implements hook_permission().
- */
-function wf_jenkins_permission() {
-  $perms = array();
-
-  $perms['update job sandbox code'] = array(
-    'title' => t('Update job sandbox code'),
-  );
-
-  return $perms;
-}
-
-/**
- * Page callback for job/%wf_job/update-code
- */
-function wf_jenkins_update_job_code_form($form, $form_state, $job) {
-  $job_uri = entity_uri('wf_job', $job);
-  return confirm_form(
-    $form,
-    t('Are you sure you want to update the code for job <strong>@job</strong>', array('@job' => entity_label('wf_job', $job))),
-    $job_uri['path'],
-    t('This action takes at least a few minutes to complete.'),
-    t('Update code'),
-    t('Cancel')
-  );
-}
-
-/**
- * Submit handler for wf_jenkins_update_job_code_form.
- */
-function wf_jenkins_update_job_code_form_submit($form, &$form_state) {
-  $job = reset($form_state['build_info']['args']);
+function wf_jenkins_update_code_submit($job) {
   wf_jenkins_start_update_code($job);
 }
 
@@ -79,7 +33,7 @@ function wf_jenkins_start_update_code($job) {
   $query = array(
     'GIT_BRANCH' => wf_job_slug($job->jid),
   );
-  // Schedule the code update in Jenkins
+  // Schedule the code update in Jenkins.
   jenkins_request($path, $query);
 
   drupal_set_message(t('A code update for this job has commenced'));
@@ -96,7 +50,7 @@ function wf_jenkins_action_event_invoke($event, $job) {
   $assigned = user_load($job->assigned);
   $env = wf_environment_load($job->eid);
 
-  rules_invoke_event_by_args("wf_jenkins_$event", array(
+  rules_invoke_event_by_args("wf_job_$event", array(
     'job' => $job,
     'environment' => $env,
     'owner' => $owner,
diff --git a/wf_jenkins/wf_jenkins.rules.inc b/wf_jenkins/wf_jenkins.rules.inc
index dfa0b65..1531ac8 100644
--- a/wf_jenkins/wf_jenkins.rules.inc
+++ b/wf_jenkins/wf_jenkins.rules.inc
@@ -1,36 +1,23 @@
 <?php
 /**
- * Implements hook_rules_event_info().
+ * @file
+ * Workflow jenkins rules.
  */
-function wf_jenkins_rules_event_info() {
-  $defaults = array(
-    'group' => t('Jenkins'),
-    'module' => 'wf_jenkins',
-    'access callback' => 'wf_jenkins_rules_integration_access',
-  );
-
-  $default_variables = array(
-    'job' => array('type' => 'wf_job', 'label' => t('The job affected')),
-    'environment' => array('type' => 'wf_environment', 'label' => t('The job\'s current environment')),
-    'owner' => array('type' => 'user', 'label' => t('The owner of the job')),
-    'assigned' => array('type' => 'user', 'label' => t('The user assigned the job')),
-  );
 
+/**
+ * Implementation of hook_rules_action_info().
+ */
+function wf_jenkins_rules_action_info() {
   return array(
-    'wf_jenkins_updated_code' => $defaults + array(
-      'label' => t('After a job\'s code has been updated.'),
-      'variables' => $default_variables,
-    ),
-    'wf_jenkins_start_update_code' => $defaults + array(
-      'label' => t('When a code update is started for a job.'),
-      'variables' => $default_variables,
+    'wf_jenkins_update_code_submit' => array(
+      'label' => t('Update code for given job using Jenkins.'),
+      'group' => t('WF Jenkins'),
+      'parameter' => array(
+        'job' => array(
+          'type' => 'wf_job',
+          'label' => 'Job',
+        ),
+      ),
     ),
   );
 }
-
-/**
- * Access callback for wf_jenkins rules integration.
- */
-function wf_jenkins_rules_integration_access($type, $name) {
-  return user_access('administer jenkins requests');
-}
diff --git a/wf_job/includes/wf_job.admin.inc b/wf_job/includes/wf_job.admin.inc
index 7670b1d..a584fa0 100644
--- a/wf_job/includes/wf_job.admin.inc
+++ b/wf_job/includes/wf_job.admin.inc
@@ -2,7 +2,7 @@
 
 /**
  * @file
- *   Workflow job admin functions.
+ * Workflow job admin functions.
  */
 
 /**
diff --git a/wf_job/includes/wf_job.drush.inc b/wf_job/includes/wf_job.drush.inc
index 118bd88..e25fcc8 100644
--- a/wf_job/includes/wf_job.drush.inc
+++ b/wf_job/includes/wf_job.drush.inc
@@ -9,7 +9,7 @@
  */
 function wf_job_drush_command() {
   $items = array();
-  
+
   $items['job-drush-aliases'] = array(
     'description' => 'Render aliases.drushrc.php file contents',
     'examples' => array(
diff --git a/wf_job/wf_job.module b/wf_job/wf_job.module
index 2397ecd..eea3533 100644
--- a/wf_job/wf_job.module
+++ b/wf_job/wf_job.module
@@ -167,6 +167,13 @@ function wf_job_menu() {
     'file' => 'includes/wf_job.pages.inc',
     'weight' => 10,
   );
+  $items['job/%wf_job/update-code'] = array(
+    'title' => 'Update code',
+    'access arguments' => array('update job sandbox code'),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('wf_job_update_job_code_form', 1),
+    'type' => MENU_LOCAL_TASK,
+  );
   $items['admin/content/jobs/drush-aliases'] = array(
     'title' => 'Download drush aliases',
     'description' => 'Admin page for exporting drush wf.aliases.drushrc.php file',
@@ -193,6 +200,30 @@ function wf_job_menu() {
 }
 
 /**
+ * Page callback for job/%wf_job/update-code.
+ */
+function wf_job_update_job_code_form($form, $form_state, $job) {
+  $job_uri = entity_uri('wf_job', $job);
+  return confirm_form(
+    $form,
+    t('Are you sure you want to update the code for job <strong>@job</strong>', array('@job' => entity_label('wf_job', $job))),
+    $job_uri['path'],
+    t('This action takes at least a few minutes to complete.'),
+    t('Update code'),
+    t('Cancel')
+  );
+}
+
+/**
+ * Submit handler for wf_job_update_job_code_form.
+ */
+function wf_job_update_job_code_form_submit($form, &$form_state) {
+  // Gets the current job and fires wf_job_update_code_submit rules event.
+  $job = reset($form_state['build_info']['args']);
+  rules_invoke_event('wf_job_update_code_submit', $job);
+}
+
+/**
  * Implements hook_menu_local_tasks_alter().
  */
 function wf_job_menu_local_tasks_alter(&$data, $router_item, $root_path) {
@@ -255,6 +286,10 @@ function wf_job_permission() {
     'title' => t('Review own jobs.'),
   );
 
+  $perms['update job sandbox code'] = array(
+    'title' => t('Update job sandbox code'),
+  );
+
   return $perms;
 }
 
diff --git a/wf_job/wf_job.rules.inc b/wf_job/wf_job.rules.inc
index 8db6958..5871951 100644
--- a/wf_job/wf_job.rules.inc
+++ b/wf_job/wf_job.rules.inc
@@ -1,5 +1,10 @@
 <?php
 /**
+ * @file
+ * Workflow job rules.
+ */
+
+/**
  * Implements hook_rules_event_info().
  */
 function wf_job_rules_event_info() {
@@ -47,6 +52,18 @@ function wf_job_rules_event_info() {
       'label' => t('After a job is deployed to the final environment'),
       'variables' => $default_variables,
     ),
+    'wf_job_update_code_submit' => $defaults + array(
+      'label' => t('When a user clicks the Update code button.'),
+      'variables' => array('job' => array('type' => 'wf_job', 'label' => t('The job affected'))),
+    ),
+    'wf_job_start_update_code' => $defaults + array(
+      'label' => t('When a code update is started for a job.'),
+      'variables' => array('job' => array('type' => 'wf_job', 'label' => t('The job affected'))),
+    ),
+    'wf_job_updated_code' => $defaults + array(
+      'label' => t('After a job\'s code has been updated.'),
+      'variables' => array('job' => array('type' => 'wf_job', 'label' => t('The job affected'))),
+    ),
   );
 }
 
