diff --git a/themekey.module b/themekey.module
index c711b2c..22a3e83 100644
--- a/themekey.module
+++ b/themekey.module
@@ -269,6 +269,71 @@ function themekey_is_active() {
 }
 
 /**
+ * Checks if a theme is enabled and fires warning messages
+ * to the site's administrator
+ *
+ * @param $theme
+ *   name of the theme as string
+ *
+ * @param $settings_page
+ *   boolean that indicates if the function
+ *   is called from ThemeKey's administration
+ *   backend which causes a different message
+ *
+ * @return
+ *   TRUE if the theme is enabled, otherwise FALSE
+ */
+function themekey_check_theme_enabled($theme, $settings_page = FALSE) {
+  static $themes_enabled = array();
+  static $warned = FALSE;
+  static $displayed_error = FALSE;
+
+  if (!$theme || 'default' == $theme) {
+    return TRUE;
+  }
+
+  if (empty($themes_enabled)) {
+
+    if ($result = db_select('system', 's')
+      ->fields('s', array('name'))
+      ->condition('type', 'theme')
+      ->condition('status', '1')
+      ->execute()
+    ) {
+      foreach ($result as $row) {
+        $themes_enabled[] = $row->name;
+      }
+
+    }
+  }
+
+  if (in_array($theme, $themes_enabled)) {
+    return TRUE;
+  }
+  elseif ('ThemeKeyAdminTheme' == $theme && variable_get('admin_theme', '0') && in_array(variable_get('admin_theme', '0'), $themes_enabled)) {
+    return TRUE;
+  }
+
+  if ($settings_page) {
+    if (!$displayed_error) {
+      drupal_set_message(filter_xss(t("Your current configuration of theme rules uses at least one theme that is not enabled. Nevertheless, this configuration is stored, but affected rules won't be applied until the targeted theme is enabled at !build_themes.",
+        array('!build_themes' => l(t('!path', array('!path' => 'admin/appearance')), 'admin/appearance')))), 'error');
+      $displayed_error = TRUE;
+    }
+  }
+  else {
+    if (!$warned && variable_get('themekey_debug_trace_rule_switching', FALSE)) {
+      // Don't use the l() function at this early stage of bootstrapping because it will initialize the theme engine. Use url() instead.
+      themekey_set_debug_message('A matching Theme Switching Rule to select theme %theme was not applied because this theme is disabled. You can enable this theme at !build_themes, remove this Theme Switching Rule at !themekey_properties, or edit the current node if the theme was selected using ThemeKey UI.',
+        array('%theme' => $theme, '!build_themes' => '<a href="' . url('admin/appearance') . '">admin/appearance</a>', '!themekey_properties' => '<a href="' . url('admin/config/user-interface/themekey/properties') . '">admin/config/user-interface/themekey/properties</a>'));
+      $warned = TRUE;
+    }
+  }
+
+  return FALSE;
+}
+
+/**
  * Implements hook_help().
  */
 function themekey_help($path, $arg) {
diff --git a/themekey_base.inc b/themekey_base.inc
index f1b876b..45b542c 100644
--- a/themekey_base.inc
+++ b/themekey_base.inc
@@ -567,72 +567,6 @@ function themekey_property_value(&$parameters, $property) {
   return $parameters[$property];
 }
 
-
-/**
- * Checks if a theme is enabled and fires warning messages
- * to the site's administrator
- *
- * @param $theme
- *   name of the theme as string
- *
- * @param $settings_page
- *   boolean that indicates if the function
- *   is called from ThemeKey's administration
- *   backend which causes a different message
- *
- * @return
- *   TRUE if the theme is enabled, otherwise FALSE
- */
-function themekey_check_theme_enabled($theme, $settings_page = FALSE) {
-  static $themes_enabled = array();
-  static $warned = FALSE;
-  static $displayed_error = FALSE;
-
-  if (!$theme || 'default' == $theme) {
-    return TRUE;
-  }
-
-  if (empty($themes_enabled)) {
-
-    if ($result = db_select('system', 's')
-      ->fields('s', array('name'))
-      ->condition('type', 'theme')
-      ->condition('status', '1')
-      ->execute()
-    ) {
-      foreach ($result as $row) {
-        $themes_enabled[] = $row->name;
-      }
-
-    }
-  }
-
-  if (in_array($theme, $themes_enabled)) {
-    return TRUE;
-  }
-  elseif ('ThemeKeyAdminTheme' == $theme && variable_get('admin_theme', '0') && in_array(variable_get('admin_theme', '0'), $themes_enabled)) {
-    return TRUE;
-  }
-
-  if ($settings_page) {
-    if (!$displayed_error) {
-      drupal_set_message(filter_xss(t("Your current configuration of theme rules uses at least one theme that is not enabled. Nevertheless, this configuration is stored, but affected rules won't be applied until the targeted theme is enabled at !build_themes.",
-        array('!build_themes' => l(t('!path', array('!path' => 'admin/appearance')), 'admin/appearance')))), 'error');
-      $displayed_error = TRUE;
-    }
-  }
-  else {
-    if (!$warned && variable_get('themekey_debug_trace_rule_switching', FALSE)) {
-      // Don't use the l() function at this early stage of bootstrapping because it will initialize the theme engine. Use url() instead.
-      themekey_set_debug_message('A matching Theme Switching Rule to select theme %theme was not applied because this theme is disabled. You can enable this theme at !build_themes, remove this Theme Switching Rule at !themekey_properties, or edit the current node if the theme was selected using ThemeKey UI.',
-        array('%theme' => $theme, '!build_themes' => '<a href="' . url('admin/appearance') . '">admin/appearance</a>', '!themekey_properties' => '<a href="' . url('admin/config/user-interface/themekey/properties') . '">admin/config/user-interface/themekey/properties</a>'));
-      $warned = TRUE;
-    }
-  }
-
-  return FALSE;
-}
-
 /**
  * @todo Please document this function.
  * @see http://drupal.org/node/1354
