diff --git engines/qr_codes_qrencode.module engines/qr_codes_qrencode.module
index 2fe5bbe..c38dac1 100644
--- engines/qr_codes_qrencode.module
+++ engines/qr_codes_qrencode.module
@@ -1,56 +1,98 @@
 <?php
 
+
 define('QR_CODES_QRENCODE_PATH', variable_get('qr_codes_qrencode_path', qr_codes_qrencode_path('qrencode')));
 
+
 /**
- * Implementation of hook_qr_codes().
+ * Generate a QR Code
+ * Implementation of hook_qr_codes_generate()
+ * 
+ * @param  string $a2     file path for output
+ * @param  string $data   text to be encoded
+ * @param  int $width  width of outputted image
+ * @param  int $height height of outputted image
+ * @param  int $margin margin around image
  */
-function qr_codes_qrencode_qr_codes($op, $a2 = NULL, $data = NULL, $width = NULL, $height = NULL, $margin = NULL) {
-  switch ($op) {
-    case 'list':
-      return array('qr_codes_qrencode:qrencode' => t('Libqrencode'));
-
-    case 'description':
-      return t('Qrencode. Libqrencode is a C library for encoding data in a QR Code. See <a href="http://megaui.net/fukuchi/works/qrencode/index.en.html">http://megaui.net/fukuchi/works/qrencode/index.en.html</a>');
+function qr_codes_qrencode_qr_codes_generate($a2 = NULL, $data = NULL, $width = NULL, $height = NULL, $margin = NULL){
+  $options = array(
+    'output' => drupal_realpath($a2),
+  );
+  if (!is_null($margin)) {
+    $options['margin'] = $margin;
+  }
+  $command = QR_CODES_QRENCODE_PATH;
+  foreach ($options as $k => $v) {
+    $command .= ' --'. $k . ($v === TRUE ? '' : '='. escapeshellarg((string)$v));
+  }
 
-    case 'config':
-      if ($version = qr_codes_qrencode_version()) {
-        drupal_set_message(t('Qrencode @version is installed on your system.', array('@version' => $version)));
-      }
-      else {
-        drupal_set_message(t('<a href="@qrencode">Qrencode</a> is not available on the server, or the <a href="@settings">configuration settings</a> are incorrect.', array('@qrencode' => 'http://megaui.net/fukuchi/works/qrencode/index.en.html', '@settings' => url('admin/settings/qr_codes/qrencode'))), 'error');
-      }
-      $form['qr_codes_qrencode_path'] = array(
-        '#type' => 'textfield',
-        '#title' => t('Path to encoder'),
-        '#default_value' => QR_CODES_QRENCODE_PATH,
-        '#size' => 60,
-        '#maxlength' => 255,
-        '#required' => TRUE,
-        '#description' => t('A file system path to the <code>qrencode</code> binary. On Unix systems, this would typically be located at <code>/usr/bin/qrencode</code> or <code>/usr/local/bin/qrencode</code>. On Mac OS X with MacPorts, the path would typically be <code>/opt/local/bin/qrencode</code>.'),
-      );
-      return $form;
+  if ($handle = popen($command, 'w')) {
+    fwrite($handle, $data);
+    return pclose($handle) === 0 ? $a2 : FALSE;
+  }
+}
 
-    case 'generate':
-      $options = array(
-        'output' => $a2,
-      );
-      if (!is_null($margin)) {
-        $options['margin'] = $margin;
-      }
+/**
+ * Get list description info
+ * Implementation of hook_qr_codes_list()
+ * 
+ * @param  string $a2     file path for output
+ * @param  string $data   text to be encoded
+ * @param  int $width  width of outputted image
+ * @param  int $height height of outputted image
+ * @param  int $margin margin around image
+ * @return array list description info
+ */
+function qr_codes_qrencode_qr_codes_list($a2 = NULL, $data = NULL, $width = NULL, $height = NULL, $margin = NULL){
+  return array('qr_codes_qrencode:qrencode' => t('Libqrencode'));
+}
 
-      $command = QR_CODES_QRENCODE_PATH;
-      foreach ($options as $k => $v) {
-        $command .= ' --'. $k . ($v === TRUE ? '' : '='. escapeshellarg((string)$v));
-      }
+/**
+ * Get description info
+ * Implementation of hook_qr_codes_description()
+ * 
+ * @param  string $a2     file path for output
+ * @param  string $data   text to be encoded
+ * @param  int $width  width of outputted image
+ * @param  int $height height of outputted image
+ * @param  int $margin margin around image
+ * @return string description info
+ */
+function qr_codes_qrencode_qr_codes_description($a2 = NULL, $data = NULL, $width = NULL, $height = NULL, $margin = NULL){
+  return t('Qrencode. Libqrencode is a C library for encoding data in a QR Code. See <a href="http://megaui.net/fukuchi/works/qrencode/index.en.html">http://megaui.net/fukuchi/works/qrencode/index.en.html</a>');
+}
 
-      if ($handle = popen($command, 'w')) {
-        fwrite($handle, $data);
-        return pclose($handle) === 0 ? $options['output'] : FALSE;
-      }
+/**
+ * Configure this sub-module
+ * Implementation of hook_qr_codes_config()
+ * 
+ * @param  string $a2     file path for output
+ * @param  string $data   text to be encoded
+ * @param  int $width  width of outputted image
+ * @param  int $height height of outputted image
+ * @param  int $margin margin around image
+ * @return array form for configuring
+ */
+function qr_codes_qrencode_qr_codes_config($a2 = NULL, $data = NULL, $width = NULL, $height = NULL, $margin = NULL){
+  if ($version = qr_codes_qrencode_version()) {
+    drupal_set_message(t('Qrencode @version is installed on your system.', array('@version' => $version)));
   }
+  else {
+    drupal_set_message(t('<a href="@qrencode">Qrencode</a> is not available on the server, or the <a href="@settings">configuration settings</a> are incorrect.', array('@qrencode' => 'http://megaui.net/fukuchi/works/qrencode/index.en.html', '@settings' => url('admin/settings/qr_codes/qrencode'))), 'error');
+  }
+  $form['qr_codes_qrencode_path'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Path to encoder'),
+    '#default_value' => QR_CODES_QRENCODE_PATH,
+    '#size' => 60,
+    '#maxlength' => 255,
+    '#required' => TRUE,
+    '#description' => t('A file system path to the <code>qrencode</code> binary. On Unix systems, this would typically be located at <code>/usr/bin/qrencode</code> or <code>/usr/local/bin/qrencode</code>. On Mac OS X with MacPorts, the path would typically be <code>/opt/local/bin/qrencode</code>.'),
+  );
+  return $form;
 }
 
+
 /**
  * Attempts to locate a qrencode binary in $PATH.
  */
diff --git qr_codes.admin.inc qr_codes.admin.inc
index ff4062d..d01dec4 100644
--- qr_codes.admin.inc
+++ qr_codes.admin.inc
@@ -9,8 +9,9 @@
  * Settings callback for 'admin/config/qr_codes' path.
  */
 function qr_codes_settings($form, &$form_state) {
+
   $form = array();
-  $options = module_invoke_all('qr_codes', 'list');
+  $options = module_invoke_all('qr_codes_list');
 
   if (count($options)) {
     $engine = variable_get('qr_codes_engine', 'qr_codes_google_chart:google_chart');
@@ -85,7 +86,7 @@ function qr_codes_settings($form, &$form_state) {
  *  FAPI Array.
  */
 function qr_codes_engine_settings($form, $form_state, $module, $engine_id) {
-  return system_settings_form(module_invoke($module, 'qr_codes', 'config', $engine_id));
+  return system_settings_form(module_invoke($module, 'qr_codes_config', $engine_id));
 }
 
 /**
@@ -93,8 +94,9 @@ function qr_codes_engine_settings($form, $form_state, $module, $engine_id) {
  */
 function qr_codes_clear_cache() {
   $dir = file_directory_path() . '/' . variable_get('qr_codes_cache_dir', 'qr_codes');
-  $options = array('callback' => 'file_delete');
+  $options = array('callback' => 'file_unmanaged_delete');
   $count = count(file_scan_directory($dir, '/\.png$/', $options));
+
   if ($count) {
     drupal_set_message(t('QR Codes local cache cleared. @count files have been deleted.', array('@count' => $count)));
   }
