diff --git a/xautoload.module b/xautoload.module
index 201df4b..fd559cd 100644
--- a/xautoload.module
+++ b/xautoload.module
@@ -3,6 +3,7 @@
 use Drupal\xautoload\ClassLoader\ApcClassLoader;
 use Drupal\xautoload\ClassLoader\WinCacheClassLoader;
 use Drupal\xautoload\ClassLoader\XCacheClassLoader;
+use Drupal\xautoload\Discovery\WildcardFileFinder;
 use Drupal\xautoload\FinderOperation\RegisterActiveExtensionsOperation;
 use Drupal\xautoload\FinderOperation\LoaderSetFinderOperation;
 use Drupal\xautoload\FinderOperation\HookXautoloadOperation;
@@ -96,21 +97,108 @@ function xautoload_module_implements_alter(&$implementations, $hook) {
       // Move xautoload_$hook() to the start.
       $implementations = array('xautoload' => FALSE) + $implementations;
       break;
-    case 'form_system_performance_settings_alter':
-      $implementations['xautoload'] = 'ui';
-      module_load_include('ui.inc', 'xautoload');
-      break;
-    case 'modules_installed':
-    case 'modules_enabled':
-    case 'registry_files_alter':
-      $implementations['xautoload'] = 'system';
-      module_load_include('system.inc', 'xautoload');
-      break;
     default:
       return;
   }
 }
 
+/**
+ * Implements hook_modules_enabled().
+ */
+function xautoload_modules_enabled($modules) {
+  xautoload()->extensionRegistrationService->registerExtensionsByName($modules);
+  xautoload()->cacheManager->renewCachePrefix();
+
+  // Trigger invocation of hook_xautoload() to catch any hooks.
+  $operation = new HookXautoloadOperation();
+  xautoload()->proxyFinder->onFinderInit($operation);
+}
+
+/**
+ * Implements hook_modules_installed().
+ */
+function xautoload_modules_installed($modules) {
+  xautoload()->extensionRegistrationService->registerExtensionsByName($modules);
+  xautoload()->cacheManager->renewCachePrefix();
+}
+
+/**
+ * Implements hook_registry_files_alter()
+ *
+ * Support wildcard syntax in the files[] setting in your module's info file.
+ * See https://drupal.org/node/1976198
+ *
+ * @param array[] &$files
+ *   List of files specified in files[] array in module info files.
+ *   Format:
+ *
+ *     $files['modules/field/field.attach.inc'] = array(
+ *       'module' => 'field',
+ *       'weight' => 0,
+ *     );
+ *     // Wildcard syntax.
+ *     $files['sites/all/modules/foo/inc/**'] = array(
+ *       'module' => 'foo',
+ *       'weight' => 0,
+ *     );
+ *
+ *   This function will remove the entry for foo/inc/**, and instead add all the
+ *   individual class files found in the foo/inc/ folder.
+ *
+ * @param stdClass[] $modules
+ *   Array keys are numeric.
+ *   Array values are objects each representing a module.
+ *   This parameter will be ignored.
+ */
+function xautoload_registry_files_alter(&$files, $modules) {
+  $file_finder = new WildcardFileFinder();
+  $file_finder->addDrupalPaths($files);
+  $files = $file_finder->getDrupalFiles();
+}
+
+/**
+ * Implements hook_form_FORM_ID_alter()
+ * with FORM_ID = "system_performance_settings"
+ */
+function xautoload_form_system_performance_settings_alter(&$form, $form_state) {
+
+  $form['xautoload'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('X Autoload'),
+  );
+
+  $cache_status = array(
+    'apc' => (extension_loaded('apc') && function_exists('apc_store')),
+    'wincache' => (extension_loaded('WinCache') && function_exists('wincache_ucache_get')),
+    'xcache' => (extension_loaded('Xcache') && function_exists('xcache_get')),
+  );
+  $cache_names = array(
+    'apc' => 'APC',
+    'wincache' => 'WinCache',
+    'xcache' => 'XCache',
+  );
+  $options = array();
+  foreach ($cache_names as $key => $title) {
+    $options[$key] = t('@cache_name (@status)', array(
+      '@cache_name' => $title,
+      '@status' => $cache_status[$key] ? t('Running and available') : t('Not currently available'),
+    ));
+  }
+
+  $form['xautoload']['xautoload_cache_types'] = array(
+    '#type' => 'checkboxes',
+    '#title' => t('Cache mode'),
+    '#default_value' => variable_get('xautoload_cache_types', array()),
+    '#options' => $options,
+  );
+
+  $form['xautoload']['xautoload_cache_lazy'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Postpone registration of module namespaces until the first cache miss (recommended).'),
+    '#default_value' => variable_get('xautoload_cache_lazy', FALSE),
+  );
+}
+
 // Hooks on behalf of other modules
 // -----------------------------------------------------------------------------
 
diff --git a/xautoload.system.inc b/xautoload.system.inc
deleted file mode 100644
index 0b4803c..0000000
--- a/xautoload.system.inc
+++ /dev/null
@@ -1,55 +0,0 @@
-<?php
-
-use Drupal\xautoload\Discovery\WildcardFileFinder;
-
-/**
- * Implements hook_modules_enabled()
- *
- * @param string[] $modules
- */
-function xautoload_modules_enabled($modules) {
-  xautoload()->extensionRegistrationService->registerExtensionsByName($modules);
-  xautoload()->cacheManager->renewCachePrefix();
-}
-
-/**
- * Implements hook_modules_installed()
- */
-function xautoload_modules_installed($modules) {
-  xautoload()->extensionRegistrationService->registerExtensionsByName($modules);
-  xautoload()->cacheManager->renewCachePrefix();
-}
-
-/**
- * Implements hook_registry_files_alter()
- *
- * Support wildcard syntax in the files[] setting in your module's info file.
- * See https://drupal.org/node/1976198
- *
- * @param array[] &$files
- *   List of files specified in files[] array in module info files.
- *   Format:
- *
- *     $files['modules/field/field.attach.inc'] = array(
- *       'module' => 'field',
- *       'weight' => 0,
- *     );
- *     // Wildcard syntax.
- *     $files['sites/all/modules/foo/inc/**'] = array(
- *       'module' => 'foo',
- *       'weight' => 0,
- *     );
- *
- *   This function will remove the entry for foo/inc/**, and instead add all the
- *   individual class files found in the foo/inc/ folder.
- *
- * @param stdClass[] $modules
- *   Array keys are numeric.
- *   Array values are objects each representing a module.
- *   This parameter will be ignored.
- */
-function xautoload_registry_files_alter(&$files, $modules) {
-  $file_finder = new WildcardFileFinder();
-  $file_finder->addDrupalPaths($files);
-  $files = $file_finder->getDrupalFiles();
-}
\ No newline at end of file
diff --git a/xautoload.ui.inc b/xautoload.ui.inc
deleted file mode 100644
index 164cd99..0000000
--- a/xautoload.ui.inc
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-/**
- * Implements hook_form_FORM_ID_alter()
- * with FORM_ID = "system_performance_settings"
- */
-function xautoload_form_system_performance_settings_alter(&$form, $form_state) {
-
-  $form['xautoload'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('X Autoload'),
-  );
-
-  $cache_status = array(
-    'apc' => (extension_loaded('apc') && function_exists('apc_store')),
-    'wincache' => (extension_loaded('WinCache') && function_exists('wincache_ucache_get')),
-    'xcache' => (extension_loaded('Xcache') && function_exists('xcache_get')),
-  );
-  $cache_names = array(
-    'apc' => 'APC',
-    'wincache' => 'WinCache',
-    'xcache' => 'XCache',
-  );
-  $options = array();
-  foreach ($cache_names as $key => $title) {
-    $options[$key] = t('@cache_name (@status)', array(
-      '@cache_name' => $title,
-      '@status' => $cache_status[$key] ? t('Running and available') : t('Not currently available'),
-    ));
-  }
-
-  $form['xautoload']['xautoload_cache_types'] = array(
-    '#type' => 'checkboxes',
-    '#title' => t('Cache mode'),
-    '#default_value' => variable_get('xautoload_cache_types', array()),
-    '#options' => $options,
-  );
-
-  $form['xautoload']['xautoload_cache_lazy'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Postpone registration of module namespaces until the first cache miss (recommended).'),
-    '#default_value' => variable_get('xautoload_cache_lazy', FALSE),
-  );
-}
\ No newline at end of file
