diff --git a/configuration.module b/configuration.module
index d5ff9dd..3416782 100644
--- a/configuration.module
+++ b/configuration.module
@@ -1089,8 +1089,56 @@ function configuration_hook_info() {
 }
 
 /**
+ * Updates the status of a component after it was updated.
+ *
+ * @param $component
+ *   The type of component, i.e node, user_permissions, taxonomy.
+ * @param $identifier
+ *   The identifier for the component, usually the machine name.
+ * @param $items
+ *   Items from the activestore.
+ * @param $items_code
+ *   Items loaded from the datastore.
+ * @param $from_activestore
+ *   @TODO: Explain what this param means.
+ */
+function configuration_update_component_status($component, $identifier, $items, $items_code, $from_activestore) {
+
+  // If this was the previous configuration in activestore don't mark this as changed.
+  $config = configuration_get_configuration();
+
+  $status = $config[$component][$identifier]['status'];
+
+  $md5_datastore = (is_array($items_code) && array_key_exists($identifier, $items_code)) ? md5(serialize($items_code[$identifier])) : '';
+  $md5_activestore = (is_array($items) && array_key_exists($identifier, $items)) ? md5(serialize($items[$identifier])) : '';
+
+  // Configs in code are not the same as what was just saved in activestore.
+  if ($md5_datastore != $md5_activestore) {
+    $status |= ($from_activestore) ? CONFIGURATION_ACTIVESTORE_OVERRIDDEN : CONFIGURATION_DATASTORE_OVERRIDDEN;
+  }
+  // Config in the activestore is the same as what is in code.
+  else {
+    $status = CONFIGURATION_IN_SYNC;
+    configuration_set_hash($component, $identifier, $md5_activestore);
+  }
+  configuration_set_status($component, $identifier, $status);
+
+  // When checking for new configurations, check to see if configurations are
+  // the same in datastore as last activestore. Remove the datastore overridden.
+  if ($md5_datastore == $config[$component][$identifier]['hash']) {
+    $status = $status & ~CONFIGURATION_DATASTORE_OVERRIDDEN;
+    configuration_set_status($component, $identifier, $status);
+  }
+
+  // Store the config array in cache for easy access
+  $configuration[$component][$identifier]['datastore'] = (is_array($items_code) && array_key_exists($identifier, $items_code)) ? $items_code[$identifier] : '';
+  $configuration[$component][$identifier]['activestore'] = (is_array($items) && array_key_exists($identifier, $items)) ? $items[$identifier] : '';
+  cache_set("$component:$identifier", $configuration, 'cache_configuration');
+}
+
+/**
  * Include the observers
  */
 foreach (file_scan_directory(drupal_get_path('module', 'configuration') . '/observers', '/.*/') as $filename) {
   require $filename->uri;
-}
\ No newline at end of file
+}
diff --git a/includes/configuration.ctools.inc b/includes/configuration.ctools.inc
index fa61ebd..2c3906f 100644
--- a/includes/configuration.ctools.inc
+++ b/includes/configuration.ctools.inc
@@ -412,48 +412,7 @@ function ctools_configuration_check($identifier) {
       }
     }
 
-
-    /**
-     * @todo This code is reused in all component files.
-     */
-    $return = '';
-    $status = $config[$component][$identifier]['status'];
-    $md5_datastore = (is_array($export_code) && array_key_exists($identifier, $export_code)) ? md5(serialize($export_code[$identifier])) : '';
-    $md5_activestore = (is_array($export_code) && array_key_exists($identifier, $export_code)) ? md5(serialize($export[$identifier])) : '';
-
-    // Configs in code are not the same as what was just saved in activestore.
-    // There is no way of telling if the change was in the activestore or the
-    // datastore. Mark them changed in both.
-    if ($md5_datastore == $config[$component][$identifier]['hash'] && $md5_datastore != $md5_activestore) {
-      // dsm('configs in code are not the same as what was just saved in activestore.');
-      $status = $status | CONFIGURATION_ACTIVESTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-    // Menu in the activestore is the same as what is in code.
-    if ($md5_activestore == $md5_datastore) {
-      // dsm('config in activestore are same as what is in code');
-      $status = CONFIGURATION_IN_SYNC;
-      configuration_set_status($component, $identifier,  $status);
-      configuration_set_hash($component, $identifier, $md5_activestore);
-    }
-    if ($md5_activestore != $md5_datastore) {
-      $status = $status | CONFIGURATION_DATASTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-    // When checking for new configurations, check to see if configurations are
-    // the same in datastore as last activestore
-    if (!$from_activestore && $md5_datastore == $config[$component][$identifier]['hash']) {
-      // dsm('config in code are same as last in activestore');
-      $status = $status  & ~CONFIGURATION_DATASTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-
-    // Store the config array in cache for easy access
-    if ($status != CONFIGURATION_IN_SYNC) {
-      $configuration[$component][$identifier]['activestore'] = (is_array($export_code) && array_key_exists($identifier, $export_code)) ? $export[$identifier] : '';
-      $configuration[$component][$identifier]['datastore'] = (is_array($export_code) && array_key_exists($identifier, $export_code)) ? $export_code[$identifier] : '';
-      cache_set("$component:$identifier", $configuration, 'cache_configuration');
-    }
+    configuration_update_compontent($component, $identifier, $export, $export_code, $from_activestore);
   }
 }
 
diff --git a/includes/configuration.field.inc b/includes/configuration.field.inc
index 82f33f3..8dd493c 100644
--- a/includes/configuration.field.inc
+++ b/includes/configuration.field.inc
@@ -227,55 +227,13 @@ function configuration_check_field($identifier) {
 
     $fields_code = configuration_field_default_fields();
 
-    // If this was the previous configuration in activestore don't mark this as changed.
-    $config = configuration_get_configuration();
-
     // If the activestore doesn't exist it is most likely because this configuration
     // only exists in code.
     if (empty($fields)) {
       configuration_set_status($component, $identifier, CONFIGURATION_TRACKED_DATASTORE_ONLY);
     }
 
-    /**
-     * @todo This code is reused in all component files.
-     */
-    $return = '';
-    $component = 'field';
-    $status = $config[$component][$identifier]['status'];
-    $md5_datastore = (is_array($fields_code) && array_key_exists($identifier, $fields_code)) ? md5(serialize($fields_code[$identifier])) : '';
-    $md5_activestore = (is_array($fields) && array_key_exists($identifier, $fields)) ? md5(serialize($fields[$identifier])) : '';
-
-    // Configs in code are not the same as what was just saved in activestore.
-    if ($from_activestore == TRUE && $md5_datastore != $md5_activestore) {
-      // dsm('configs in code are not the same as what was just saved in activestore.');
-      $status = $status | CONFIGURATION_ACTIVESTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-    // Menu in the activestore is the same as what is in code.
-    if ($md5_activestore == $md5_datastore) {
-      // dsm('config in activestore are same as what is in code');
-      $status = CONFIGURATION_IN_SYNC;
-      configuration_set_status($component, $identifier, $status);
-      configuration_set_hash($component, $identifier, $md5_activestore);
-    }
-    if ($md5_activestore != $md5_datastore && $md5_datastore != $config['field'][$identifier]['hash']) {
-      $status = $status | CONFIGURATION_DATASTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-    // When checking for new configurations, check to see if configurations are
-    // the same in datastore as last activestore, and remove bit.
-    if (!$from_activestore && $md5_datastore == $config['field'][$identifier]['hash']) {
-      // dsm('config in code are same as last in activestore');
-      $status = $status & ~CONFIGURATION_DATASTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-
-    // Store the config array in cache for easy access
-    if ($status != CONFIGURATION_IN_SYNC) {
-      $configuration[$component][$identifier]['activestore'] = (is_array($fields) && array_key_exists($identifier, $fields)) ? $fields[$identifier] : '';
-      $configuration[$component][$identifier]['datastore'] = (is_array($fields_code) && array_key_exists($identifier, $fields_code)) ? $fields_code[$identifier] : '';
-      cache_set("$component:$identifier", $configuration, 'cache_configuration');
-    }
+    configuration_update_component_status($component, $identifier, $fields, $fields_code, $from_activestore);
   }
 }
 
diff --git a/includes/configuration.filter.inc b/includes/configuration.filter.inc
index 78225bb..278ed09 100644
--- a/includes/configuration.filter.inc
+++ b/includes/configuration.filter.inc
@@ -150,45 +150,7 @@ function configuration_check_filter($identifier) {
       configuration_set_status($component, $identifier, CONFIGURATION_TRACKED_DATASTORE_ONLY);
     }
 
-    // If this was the previous configuration in activestore don't mark this as changed.
-    $config = configuration_get_configuration();
-    /**
-     * @todo This code is reused in all component files.
-     */
-    $return = '';
-    $component = 'filter';
-    $status = $config[$component][$identifier]['status'];
-    $md5_datastore = (is_array($formats_code) && array_key_exists($identifier, $formats_code)) ? md5(serialize($formats_code[$identifier])) : '';
-    $md5_activestore = (is_array($formats_code) && array_key_exists($identifier, $formats_code)) ? md5(serialize($formats[$identifier])) : '';
-
-    // Configs in code are not the same as what was just saved in activestore.
-    if ($from_activestore == TRUE && $md5_datastore != $md5_activestore) {
-      $status = $status | CONFIGURATION_ACTIVESTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-    // Menu in the activestore is the same as what is in code.
-    if ($md5_activestore == $md5_datastore) {
-      $status = CONFIGURATION_IN_SYNC;
-      configuration_set_status($component, $identifier, $status);
-      configuration_set_hash($component, $identifier, $md5_activestore);
-    }
-    if ($md5_activestore != $md5_datastore) {
-      $status = $status | CONFIGURATION_DATASTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-    // When checking for new configurations, check to see if configurations are
-    // the same in datastore as last activestore. Remove the datastore overridden.
-    if ($md5_datastore == $config[$component][$identifier]['hash']) {
-      $status = $status & ~CONFIGURATION_DATASTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-
-    // Store the config array in cache for easy access
-    if ($status != CONFIGURATION_IN_SYNC) {
-      $configuration[$component][$identifier]['activestore'] = (is_array($formats_code) && array_key_exists($identifier, $formats_code)) ? $formats[$identifier] : '';
-      $configuration[$component][$identifier]['datastore'] = (is_array($formats_code) && array_key_exists($identifier, $formats_code)) ? $formats_code[$identifier] : '';
-      cache_set("$component:$identifier", $configuration, 'cache_configuration');
-    }
+    configuration_update_component_status($component, $identifier, $formats, $formats_code, $from_activestore);
   }
 }
 
diff --git a/includes/configuration.image.inc b/includes/configuration.image.inc
index 0d54961..a696893 100644
--- a/includes/configuration.image.inc
+++ b/includes/configuration.image.inc
@@ -131,45 +131,7 @@ function configuration_check_image($identifier) {
         configuration_set_status($component, $identifier, CONFIGURATION_TRACKED_DATASTORE_ONLY);
       }
 
-      // If this was the previous configuration in activestore don't mark this as changed.
-      $config = configuration_get_configuration();
-      /**
-       * @todo This code is reused in all component files.
-       */
-      $return = '';
-      $component = 'image';
-      $status = $config[$component][$identifier]['status'];
-      $md5_datastore = (is_array($styles_code) && array_key_exists($identifier, $styles_code)) ? md5(serialize($styles_code[$identifier])) : '';
-      $md5_activestore = (is_array($styles_code) && array_key_exists($identifier, $styles_code)) ? md5(serialize($styles[$identifier])) : '';
-
-      // Configs in code are not the same as what was just saved in activestore.
-      if ($from_activestore == TRUE && $md5_datastore != $md5_activestore) {
-        $status = $status | CONFIGURATION_ACTIVESTORE_OVERRIDDEN;
-        configuration_set_status($component, $identifier, $status);
-      }
-      // Menu in the activestore is the same as what is in code.
-      if ($md5_activestore == $md5_datastore) {
-        $status = CONFIGURATION_IN_SYNC;
-        configuration_set_status($component, $identifier, $status);
-        configuration_set_hash($component, $identifier, $md5_activestore);
-      }
-      if ($md5_activestore != $md5_datastore) {
-        $status = $status | CONFIGURATION_DATASTORE_OVERRIDDEN;
-        configuration_set_status($component, $identifier, $status);
-      }
-      // When checking for new configurations, check to see if configurations are
-      // the same in datastore as last activestore. Remove the datastore overridden.
-      if ($md5_datastore == $config[$component][$identifier]['hash']) {
-        $status = $status & ~CONFIGURATION_DATASTORE_OVERRIDDEN;
-        configuration_set_status($component, $identifier, $status);
-      }
-
-      // Store the config array in cache for easy access
-      if ($status != CONFIGURATION_IN_SYNC) {
-        $configuration[$component][$identifier]['activestore'] = (is_array($styles_code) && array_key_exists($identifier, $styles_code)) ? $styles[$identifier] : '';
-        $configuration[$component][$identifier]['datastore'] = (is_array($styles_code) && array_key_exists($identifier, $styles_code)) ? $styles_code[$identifier] : '';
-        cache_set("$component:$identifier", $configuration, 'cache_configuration');
-      }
+      configuration_update_component_status($component, $identifier, $styles, $styles_code, $from_activestore);
     }
   }
 }
diff --git a/includes/configuration.menu.inc b/includes/configuration.menu.inc
index 3d33de3..15c0874 100644
--- a/includes/configuration.menu.inc
+++ b/includes/configuration.menu.inc
@@ -338,45 +338,7 @@ function configuration_check_menu_links($identifier) {
       configuration_set_status($component, $identifier, CONFIGURATION_TRACKED_DATASTORE_ONLY);
     }
 
-    // If this was the previous configuration in activestore don't mark this as changed.
-    $config = configuration_get_configuration();
-    /**
-     * @todo This code is reused in all component files.
-     */
-    $return = '';
-    $component = 'menu_links';
-    $status = $config[$component][$identifier]['status'];
-    $md5_datastore = (is_array($menu_links_code) && array_key_exists($identifier, $menu_links_code)) ? md5(serialize($menu_links_code[$identifier])) : '';
-    $md5_activestore = (is_array($menu_links_code) && array_key_exists($identifier, $menu_links_code)) ? md5(serialize($menu_links[$identifier])) : '';
-
-    // Configs in code are not the same as what was just saved in activestore.
-    if ($from_activestore == TRUE && $md5_datastore != $md5_activestore) {
-      $status = $status | CONFIGURATION_ACTIVESTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-    // Menu in the activestore is the same as what is in code.
-    if ($md5_activestore == $md5_datastore) {
-      $status = CONFIGURATION_IN_SYNC;
-      configuration_set_status($component, $identifier, $status);
-      configuration_set_hash($component, $identifier, $md5_activestore);
-    }
-    if ($md5_activestore != $md5_datastore) {
-      $status = $status | CONFIGURATION_DATASTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-    // When checking for new configurations, check to see if configurations are
-    // the same in datastore as last activestore. Remove the datastore overridden.
-    if ($md5_datastore == $config[$component][$identifier]['hash']) {
-      $status = $status & ~CONFIGURATION_DATASTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-
-    // Store the config array in cache for easy access
-    if ($status != CONFIGURATION_IN_SYNC) {
-      $configuration[$component][$identifier]['activestore'] = (is_array($menu_links_code) && array_key_exists($identifier, $menu_links_code)) ? $menu_links[$identifier] : '';
-      $configuration[$component][$identifier]['datastore'] = (is_array($menu_links_code) && array_key_exists($identifier, $menu_links_code)) ? $menu_links_code[$identifier] : '';
-      cache_set("$component:$identifier", $configuration, 'cache_configuration');
-    }
+    configuration_update_component_status($component, $identifier, $menu_links, $menu_links_code, $from_activestore);
   }
 }
 
diff --git a/includes/configuration.node.inc b/includes/configuration.node.inc
index 00e26db..217823b 100644
--- a/includes/configuration.node.inc
+++ b/includes/configuration.node.inc
@@ -228,46 +228,7 @@ function configuration_check_node($identifier) {
         configuration_set_status($component, $identifier, CONFIGURATION_TRACKED_DATASTORE_ONLY);
       }
 
-      // If this was the previous configuration in activestore don't mark this as changed.
-      $config = configuration_get_configuration();
-      /**
-       * @todo This code is reused in all component files.
-       */
-      $return = '';
-      $component = 'node';
-      $status = $config[$component][$identifier]['status'];
-      $md5_datastore = (is_array($items_code) && array_key_exists($identifier, $items_code)) ? md5(serialize($items_code[$identifier])) : '';
-      $md5_activestore = (is_array($items_code) && array_key_exists($identifier, $items_code)) ? md5(serialize($items[$identifier])) : '';
-
-      // Configs in code are not the same as what was just saved in activestore.
-      if ($from_activestore == TRUE && $md5_datastore != $md5_activestore) {
-        // dsm('configs in code are not the same as what was just saved in activestore.');
-        $status = $status | CONFIGURATION_ACTIVESTORE_OVERRIDDEN;
-        configuration_set_status($component, $identifier, $status);
-      }
-      // Menu in the activestore is the same as what is in code.
-      if ($md5_activestore == $md5_datastore) {
-        $status = CONFIGURATION_IN_SYNC;
-        configuration_set_status($component, $identifier, $status);
-        configuration_set_hash($component, $identifier, $md5_activestore);
-      }
-      if ($md5_activestore != $md5_datastore) {
-        $status = $status | CONFIGURATION_DATASTORE_OVERRIDDEN;
-        configuration_set_status($component, $identifier, $status);
-      }
-      // When checking for new configurations, check to see if configurations are
-      // the same in datastore as last activestore. Remove the datastore overridden.
-      if ($md5_datastore == $config[$component][$identifier]['hash']) {
-        $status = $status & ~CONFIGURATION_DATASTORE_OVERRIDDEN;
-        configuration_set_status($component, $identifier, $status);
-      }
-
-      // Store the config array in cache for easy access
-      if ($status != CONFIGURATION_IN_SYNC) {
-        $configuration[$component][$identifier]['activestore'] = (is_array($items_code) && array_key_exists($identifier, $items_code)) ? $items[$identifier] : '';
-        $configuration[$component][$identifier]['datastore'] = (is_array($items_code) && array_key_exists($identifier, $items_code)) ? $items_code[$identifier] : '';
-        cache_set("$component:$identifier", $configuration, 'cache_configuration');
-      }
+      configuration_update_component_status($component, $identifier, $items, $items_code, $from_activestore);
     }
   }
 }
diff --git a/includes/configuration.taxonomy.inc b/includes/configuration.taxonomy.inc
index ada2fee..dc18f3d 100644
--- a/includes/configuration.taxonomy.inc
+++ b/includes/configuration.taxonomy.inc
@@ -129,45 +129,7 @@ function configuration_check_taxonomy($identifier) {
       configuration_set_status($component, $identifier, CONFIGURATION_TRACKED_DATASTORE_ONLY);
     }
 
-    // If this was the previous configuration in activestore don't mark this as changed.
-    $config = configuration_get_configuration();
-    /**
-     * @todo This code is reused in all component files.
-     */
-    $return = '';
-    $component = 'taxonomy';
-    $status = $config[$component][$identifier]['status'];
-    $md5_datastore = (is_array($vocab_code) && array_key_exists($identifier, $vocab_code)) ? md5(serialize($vocab_code[$identifier])) : '';
-    $md5_activestore = (is_array($vocab_code) && array_key_exists($identifier, $vocab_code)) ? md5(serialize($vocab[$identifier])) : '';
-
-    // Configs in code are not the same as what was just saved in activestore.
-    if ($from_activestore == TRUE && $md5_datastore != $md5_activestore) {
-      $status = $status | CONFIGURATION_ACTIVESTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-    // Menu in the activestore is the same as what is in code.
-    if ($md5_activestore == $md5_datastore) {
-      $status = CONFIGURATION_IN_SYNC;
-      configuration_set_status($component, $identifier, $status);
-      configuration_set_hash($component, $identifier, $md5_activestore);
-    }
-    if ($md5_activestore != $md5_datastore) {
-      $status = $status | CONFIGURATION_DATASTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-    // When checking for new configurations, check to see if configurations are
-    // the same in datastore as last activestore. Remove the datastore overridden.
-    if ($md5_datastore == $config[$component][$identifier]['hash']) {
-      $status = $status & ~CONFIGURATION_DATASTORE_OVERRIDDEN;
-      configuration_set_status($component, $identifier, $status);
-    }
-
-    // Store the config array in cache for easy access
-    if ($status != CONFIGURATION_IN_SYNC) {
-      $configuration[$component][$identifier]['activestore'] = (is_array($vocab_code) && array_key_exists($identifier, $vocab_code)) ? $vocab[$identifier] : '';
-      $configuration[$component][$identifier]['datastore'] = (is_array($vocab_code) && array_key_exists($identifier, $vocab_code)) ? $vocab_code[$identifier] : '';
-      cache_set("$component:$identifier", $configuration, 'cache_configuration');
-    }
+    configuration_update_component_status($component, $identifier, $vocab, $vocab_code, $from_activestore);
   }
 }
 
diff --git a/includes/configuration.user.inc b/includes/configuration.user.inc
index d3d70eb..e15c79e 100644
--- a/includes/configuration.user.inc
+++ b/includes/configuration.user.inc
@@ -311,39 +311,7 @@ function configuration_check_user_permission($identifier) {
      * @todo This code is reused in all component files.
      */
     foreach ($identifiers as $identifier) {
-      $component = 'user_permission';
-      $status = $config[$component][$identifier]['status'];
-      $md5_datastore = (is_array($permissions_code) && array_key_exists($identifier, $permissions_code)) ? md5(serialize($permissions_code[$identifier])) : '';
-      $md5_activestore = (is_array($permissions_code) && array_key_exists($identifier, $permissions_code)) ? md5(serialize($permissions[$identifier])) : '';
-
-      // Configs in code are not the same as what was just saved in activestore.
-      if ($from_activestore == TRUE && $md5_datastore != $md5_activestore) {
-        $status = $status | CONFIGURATION_ACTIVESTORE_OVERRIDDEN;
-        configuration_set_status($component, $identifier, $status);
-      }
-      // Menu in the activestore is the same as what is in code.
-      if ($md5_activestore == $md5_datastore) {
-        $status = CONFIGURATION_IN_SYNC;
-        configuration_set_status($component, $identifier, $status);
-        configuration_set_hash($component, $identifier, $md5_activestore);
-      }
-      if ($md5_activestore != $md5_datastore) {
-        $status = $status | CONFIGURATION_DATASTORE_OVERRIDDEN;
-        configuration_set_status($component, $identifier, $status);
-      }
-      // When checking for new configurations, check to see if configurations are
-      // the same in datastore as last activestore. Remove the datastore overridden.
-      if ($md5_datastore == $config[$component][$identifier]['hash']) {
-        $status = $status & ~CONFIGURATION_DATASTORE_OVERRIDDEN;
-        configuration_set_status($component, $identifier, $status);
-      }
-
-      // Store the config array in cache for easy access
-      if ($status != CONFIGURATION_IN_SYNC) {
-        $configuration[$component][$identifier]['activestore'] = (is_array($permissions_code) && array_key_exists($identifier, $permissions_code)) ? $permissions[$identifier] : '';
-        $configuration[$component][$identifier]['datastore'] = (is_array($permissions_code) && array_key_exists($identifier, $permissions_code)) ? $permissions_code[$identifier] : '';
-        cache_set("$component:$identifier", $configuration, 'cache_configuration');
-      }
+      configuration_update_component_status($component, $identifier, $permissions, $permissions_code, $from_activestore);
     }
   }
 }
