diff --git a/JobScheduler.inc b/JobScheduler.inc
index fde07d3..bd07a3e 100644
--- a/JobScheduler.inc
+++ b/JobScheduler.inc
@@ -15,8 +15,15 @@ class JobScheduler {
   public static function instance() {
     static $instance;
     if (!isset($instance)) {
-      $class = variable_get('job_scheduler_class', 'JobScheduler');
-      $instance = new $class();
+      // This is the key of the plugin definitions, not the name of a class.
+      $plugin = variable_get('job_scheduler_class', 'JobScheduler');
+      if ($class = ctools_plugin_load_class('job_scheduler', 'plugins', $plugin, 'handler')) {
+        $instance = new $class();
+      }
+      else {
+        // Fallback.
+        $instance = new JobScheduler();
+      }
     }
     return $instance;
   }
diff --git a/job_scheduler.module b/job_scheduler.module
index 2630340..421b246 100644
--- a/job_scheduler.module
+++ b/job_scheduler.module
@@ -20,8 +20,42 @@ function job_scheduler_cron() {
 function job_scheduler() {
   static $included;
   if (!$included) {
-    require './'. drupal_get_path('module', 'job_scheduler') ."/JobScheduler.inc";
+    module_load_include('inc', 'job_scheduler', 'JobScheduler');
     $included = TRUE;
   }
   return JobScheduler::instance();
 }
+
+/**
+ * Implementation of hook_ctools_plugin_api().
+ */
+function job_scheduler_ctools_plugin_api($module, $api) {
+  if ($module == 'job_scheduler' && $api == 'plugins') {
+    return array('version' => 1);
+  }
+}
+
+/**
+ * Implementation of hook_ctools_plugin_plugins().
+ */
+function job_scheduler_ctools_plugin_plugins() {
+  return array(
+    'cache' => TRUE,
+    'use hooks' => TRUE,
+  );
+}
+
+/**
+ * Implementation of hook_job_scheduler_plugins().
+ */
+function job_scheduler_job_scheduler_plugins() {
+  return array(
+    'JobScheduler' => array(
+      'handler' => array(
+        'path' => drupal_get_path('module', 'job_scheduler'),
+        'file' => 'JobScheduler.inc',
+        'class' => 'JobScheduler',
+      ),
+    ),
+  );
+}
