diff --git a/README.txt b/README.txt
index 4302b32..a5f86db 100644
--- a/README.txt
+++ b/README.txt
@@ -1,15 +1,15 @@
 Description
 -----------
-This module provides a convenient way to run Drupal's cron.php. After registering
-an account on easycron.com, you can get an API token. By entering this token 
-into the settings page of Easy Cron module in your Drupal site's backend, 
-you can manage a webcron at there, this webcron will call your cron.php 
-automatically according to the setting. The minimum interval of two calling 
-actions can be as low as 1 minute. You can enable the "Email Me" option to 
-receive email notices from easycron.com about the status of your cron.php execution. 
-"Log Execution" option tells easycron.com to log the response of the URL calling, 
-so that you can check the log in easycron.com's account page and make sure your 
-cron.php is running good.
+This module provides a convenient way to run Drupal's cron.php. After
+registering an account on easycron.com, you can get an API token. By entering
+this token into the settings page of Easy Cron module in your Drupal site's
+backend, you can manage a webcron at there, this webcron will call your cron.php
+automatically according to the setting. The minimum interval of two calling
+actions can be as low as 1 minute. You can enable the "Email Me" option to
+receive email notices from easycron.com about the status of your cron.php
+execution.  "Log Execution" option tells easycron.com to log the response of the
+URL calling, so that you can check the log in easycron.com's account page and
+make sure your cron.php is running good.
 
 EasyCron was written by Deng Zi Kuan (zk_deng).
 Maintained by Deng Zi Kuan.
@@ -21,6 +21,6 @@ Install
 2) Enable the module using Administer -> Site building -> Modules
    (/admin/build/modules).
 
-3) Configure settings of webcron. Visit Administer -> Site configuration -> 
-   Easy cron (admin/settings/easycron), enter the API token got from 
+3) Configure settings of webcron. Visit Administer -> Site configuration ->
+   Easy cron (admin/settings/easycron), enter the API token got from
    easycron.com, configure the webcron settings.
diff --git a/easycron.module b/easycron.admin.inc
similarity index 85%
copy from easycron.module
copy to easycron.admin.inc
index e326e13..3536312 100644
--- a/easycron.module
+++ b/easycron.admin.inc
@@ -1,31 +1,15 @@
 <?php
 
 /**
- * This module allows creating/managing a webcron job on easycron.com to run current site's cron.php
+ * @file
+ * @todo.
  */
 
 /**
- * Implements hook_help().
+ * @todo.
  */
-function easycron_help($path, $arg) {
-  $output = '';  //declare your output variable
-  switch ($path) {
-    case "admin/help#easycron":
-      $output = '<p>'.  t("Create/manage a webcron job on easycron.com to run current site's cron.php") .'</p>';
-      break;
-  }
-  return $output;
-}
-
-/**
- * Implements hook_perm().
- */
-function easycron_perm() {
-  return array('access easycron content');
-}
-
 function easycron_admin() {
-  // default cron job setings
+  // Default cron job setings.
   $easycron_settings = array(
     'minute' => variable_get('easycron_minute', '61'),
     'hour' => variable_get('easycron_hour', '25'),
@@ -35,11 +19,11 @@ function easycron_admin() {
     'email_me' => variable_get('easycron_email_me', '0'),
     'log_output_length' => variable_get('easycron_log_output_length', '0'),
     'status' => variable_get('easycron_status', '0'),
-  );  
+  );
   $easycron_token = variable_get('easycron_token', '');
 
   $form = array();
-  
+
   $form['easycron_status'] = array(
     '#type' => 'radios',
     '#title' => t('Status'),
@@ -48,17 +32,17 @@ function easycron_admin() {
     '#description' => t('This option enables or disables the webcron job running.'),
     '#required' => TRUE,
   );
-  
+
   $form['easycron_token'] = array(
     '#type' => 'textfield',
     '#title' => t('easyCron token'),
     '#default_value' => $easycron_token,
     '#size' => 32,
     '#maxlength' => 32,
-    '#description' => t("The API token you get from easycron.com."),
-    '#required' => variable_get('easycron_status', 0) ? TRUE : FALSE,
+    '#description' => t('The API token you get from easycron.com.'),
+    '#required' => (bool) variable_get('easycron_status', 0),
   );
-  
+
   $form['easycron_minute'] = array(
     '#type' => 'select',
     '#title' => t('Minute'),
@@ -139,13 +123,13 @@ function easycron_admin() {
       '56' => '56',
       '57' => '57',
       '58' => '58',
-      '59' => '59'  
+      '59' => '59',
     ),
     '#default_value' => $easycron_settings['minute'],
-    '#description' => t("Minute interval or exact minute."),
+    '#description' => t('Minute interval or exact minute.'),
     '#required' => TRUE,
   );
-  
+
   $form['easycron_hour'] = array(
     '#type' => 'select',
     '#title' => t('Hour'),
@@ -185,13 +169,13 @@ function easycron_admin() {
       '20' => '20',
       '21' => '21',
       '22' => '22',
-      '23' => '23'
-    ),  
+      '23' => '23',
+    ),
     '#default_value' => $easycron_settings['hour'],
-    '#description' => t("Hour interval or exact hour."),
+    '#description' => t('Hour interval or exact hour.'),
     '#required' => TRUE,
   );
-  
+
   $form['easycron_day'] = array(
     '#type' => 'select',
     '#title' => t('Day'),
@@ -241,13 +225,13 @@ function easycron_admin() {
       '28' => '28',
       '29' => '29',
       '30' => '30',
-      '31' => '31'  
+      '31' => '31',
     ),
     '#default_value' => $easycron_settings['day'],
-    '#description' => t("Day interval or exact day."),
+    '#description' => t('Day interval or exact day.'),
     '#required' => TRUE,
   );
-  
+
   $form['easycron_month'] = array(
     '#type' => 'select',
     '#title' => t('Month'),
@@ -269,13 +253,13 @@ function easycron_admin() {
       '9' => '9',
       '10' => '10',
       '11' => '11',
-      '12' => '12'  
+      '12' => '12',
     ),
     '#default_value' => $easycron_settings['month'],
-    '#description' => t("Month interval or exact month."),
+    '#description' => t('Month interval or exact month.'),
     '#required' => TRUE,
   );
-  
+
   $form['easycron_weekday'] = array(
     '#type' => 'select',
     '#title' => t('Weekday'),
@@ -287,23 +271,23 @@ function easycron_admin() {
       '4' => t('Thu'),
       '5' => t('Fri'),
       '6' => t('Sat'),
-      '7' => t('Sun')  
+      '7' => t('Sun'),
     ),
     '#default_value' => $easycron_settings['weekday'],
-    '#description' => t("Exact weekday."),
+    '#description' => t('Exact weekday.'),
     '#required' => TRUE,
-  );  
-  
+  );
+
   $form['easycron_email_me'] = array(
     '#type' => 'select',
     '#title' => t('Email me'),
     '#options' => array(
       '0' => t('never'),
       '1' => t('if execution fails'),
-      '2' => t('after execution')  
+      '2' => t('after execution'),
     ),
     '#default_value' => $easycron_settings['email_me'],
-    '#description' => t("Email me."),
+    '#description' => t('Email me.'),
     '#required' => TRUE,
   );
 
@@ -312,7 +296,7 @@ function easycron_admin() {
     '#title' => t('Log output'),
     '#options' => array(
       '0' => t('No'),
-      '10240' => t('Yes')  
+      '10240' => t('Yes'),
     ),
     '#default_value' => $easycron_settings['log_output_length'],
     '#description' => t("Log webcron job's output (You can check the output on easycron.com)."),
@@ -322,31 +306,37 @@ function easycron_admin() {
   return system_settings_form($form);
 }
 
+/**
+ * @todo.
+ */
 function easycron_connect($action, $easycron_settings) {
-  $settings_array = array();  
+  $settings_array = array();
   foreach ($easycron_settings as $key => $value) {
     $settings_array[] = $key . '=' . urlencode($value);
   }
   $settings_str = implode('&', $settings_array);
   $url = 'http://www.easycron.com/api/' . $action . '?' . $settings_str;
   $result = drupal_http_request($url, array(), 'GET', NULL, 3);
-    
+
   if ($result->code != 200) {
     form_set_error('', t('Cannot connect to easycron.com.'));
-  } 
+  }
   else {
     $data = unserialize($result->data);
     if ($data['status'] == '0') {
-      // setting validation failed
+      // Setting validation failed.
       return $data['notices'];
     }
     else {
-      // successfully made the settings
+      // Successfully made the settings.
       return TRUE;
     }
   }
 }
 
+/**
+ * @todo.
+ */
 function easycron_admin_validate($form, &$form_state) {
   if (strlen($form['easycron_token']['#value']) != 32) {
     form_set_error('easycron_token', t('The API token should be 32 characters\' long.'));
@@ -404,22 +394,3 @@ function easycron_admin_validate($form, &$form_state) {
     }
   }
 }
-
-/**
- * Implements hook_menu().
- */
-function easycron_menu() {
-
-  $items = array();
-
-  $items['admin/settings/easycron'] = array(
-    'title' => 'Easy cron',
-    'description' => 'Description of your easycron settings page',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('easycron_admin'),
-    'access arguments' => array('access administration pages'),
-    'type' => MENU_NORMAL_ITEM,
-   );
-
-  return $items;
-}
diff --git a/easycron.install b/easycron.install
index 872a8a5..6926b5a 100644
--- a/easycron.install
+++ b/easycron.install
@@ -1,11 +1,12 @@
 <?php
+
 /**
  * @file
  * Install, update and uninstall functions for the easycron module.
  */
 
 /**
- * Implementation of hook_uninstall().
+ * Implements hook_uninstall().
  */
 function easycron_uninstall() {
   variable_del('easycron_status');
@@ -17,4 +18,4 @@ function easycron_uninstall() {
   variable_del('easycron_weekday');
   variable_del('easycron_email_me');
   variable_del('easycron_log_output_length');
-}
\ No newline at end of file
+}
diff --git a/easycron.module b/easycron.module
index e326e13..18ab931 100644
--- a/easycron.module
+++ b/easycron.module
@@ -8,10 +8,10 @@
  * Implements hook_help().
  */
 function easycron_help($path, $arg) {
-  $output = '';  //declare your output variable
+  $output = '';
   switch ($path) {
-    case "admin/help#easycron":
-      $output = '<p>'.  t("Create/manage a webcron job on easycron.com to run current site's cron.php") .'</p>';
+    case 'admin/help#easycron':
+      $output = '<p>' .  t("Create/manage a webcron job on easycron.com to run current site's cron.php") . '</p>';
       break;
   }
   return $output;
@@ -24,392 +24,10 @@ function easycron_perm() {
   return array('access easycron content');
 }
 
-function easycron_admin() {
-  // default cron job setings
-  $easycron_settings = array(
-    'minute' => variable_get('easycron_minute', '61'),
-    'hour' => variable_get('easycron_hour', '25'),
-    'day' => variable_get('easycron_day', '32'),
-    'month' => variable_get('easycron_month', '13'),
-    'weekday' => variable_get('easycron_weekday', '8'),
-    'email_me' => variable_get('easycron_email_me', '0'),
-    'log_output_length' => variable_get('easycron_log_output_length', '0'),
-    'status' => variable_get('easycron_status', '0'),
-  );  
-  $easycron_token = variable_get('easycron_token', '');
-
-  $form = array();
-  
-  $form['easycron_status'] = array(
-    '#type' => 'radios',
-    '#title' => t('Status'),
-    '#default_value' => $easycron_settings['status'],
-    '#options' => array(t('Disabled'), t('Enabled')),
-    '#description' => t('This option enables or disables the webcron job running.'),
-    '#required' => TRUE,
-  );
-  
-  $form['easycron_token'] = array(
-    '#type' => 'textfield',
-    '#title' => t('easyCron token'),
-    '#default_value' => $easycron_token,
-    '#size' => 32,
-    '#maxlength' => 32,
-    '#description' => t("The API token you get from easycron.com."),
-    '#required' => variable_get('easycron_status', 0) ? TRUE : FALSE,
-  );
-  
-  $form['easycron_minute'] = array(
-    '#type' => 'select',
-    '#title' => t('Minute'),
-    '#options' => array(
-      '61' => '*',
-      '62' => '*/2',
-      '63' => '*/3',
-      '64' => '*/4',
-      '65' => '*/5',
-      '66' => '*/6',
-      '67' => '*/7',
-      '68' => '*/8',
-      '69' => '*/9',
-      '70' => '*/10',
-      '71' => '*/11',
-      '72' => '*/12',
-      '73' => '*/13',
-      '74' => '*/14',
-      '75' => '*/15',
-      '80' => '*/20',
-      '90' => '*/30',
-      '0' => '0',
-      '1' => '1',
-      '2' => '2',
-      '3' => '3',
-      '4' => '4',
-      '5' => '5',
-      '6' => '6',
-      '7' => '7',
-      '8' => '8',
-      '9' => '9',
-      '10' => '10',
-      '11' => '11',
-      '12' => '12',
-      '13' => '13',
-      '14' => '14',
-      '15' => '15',
-      '16' => '16',
-      '17' => '17',
-      '18' => '18',
-      '19' => '19',
-      '20' => '20',
-      '21' => '21',
-      '22' => '22',
-      '23' => '23',
-      '24' => '24',
-      '25' => '25',
-      '26' => '26',
-      '27' => '27',
-      '28' => '28',
-      '29' => '29',
-      '30' => '30',
-      '31' => '31',
-      '32' => '32',
-      '33' => '33',
-      '34' => '34',
-      '35' => '35',
-      '36' => '36',
-      '37' => '37',
-      '38' => '38',
-      '39' => '39',
-      '40' => '40',
-      '41' => '41',
-      '42' => '42',
-      '43' => '43',
-      '44' => '44',
-      '45' => '45',
-      '46' => '46',
-      '47' => '47',
-      '48' => '48',
-      '49' => '49',
-      '50' => '50',
-      '51' => '51',
-      '52' => '52',
-      '53' => '53',
-      '54' => '54',
-      '55' => '55',
-      '56' => '56',
-      '57' => '57',
-      '58' => '58',
-      '59' => '59'  
-    ),
-    '#default_value' => $easycron_settings['minute'],
-    '#description' => t("Minute interval or exact minute."),
-    '#required' => TRUE,
-  );
-  
-  $form['easycron_hour'] = array(
-    '#type' => 'select',
-    '#title' => t('Hour'),
-    '#options' => array(
-      '25' => '*',
-      '26' => '*/2',
-      '27' => '*/3',
-      '28' => '*/4',
-      '29' => '*/5',
-      '30' => '*/6',
-      '31' => '*/7',
-      '32' => '*/8',
-      '33' => '*/9',
-      '34' => '*/10',
-      '35' => '*/11',
-      '36' => '*/12',
-      '0' => '0',
-      '1' => '1',
-      '2' => '2',
-      '3' => '3',
-      '4' => '4',
-      '5' => '5',
-      '6' => '6',
-      '7' => '7',
-      '8' => '8',
-      '9' => '9',
-      '10' => '10',
-      '11' => '11',
-      '12' => '12',
-      '13' => '13',
-      '14' => '14',
-      '15' => '15',
-      '16' => '16',
-      '17' => '17',
-      '18' => '18',
-      '19' => '19',
-      '20' => '20',
-      '21' => '21',
-      '22' => '22',
-      '23' => '23'
-    ),  
-    '#default_value' => $easycron_settings['hour'],
-    '#description' => t("Hour interval or exact hour."),
-    '#required' => TRUE,
-  );
-  
-  $form['easycron_day'] = array(
-    '#type' => 'select',
-    '#title' => t('Day'),
-    '#options' => array(
-      '32' => '*',
-      '33' => '*/2',
-      '34' => '*/3',
-      '35' => '*/4',
-      '36' => '*/5',
-      '37' => '*/6',
-      '38' => '*/7',
-      '39' => '*/8',
-      '40' => '*/9',
-      '41' => '*/10',
-      '42' => '*/11',
-      '43' => '*/12',
-      '44' => '*/13',
-      '45' => '*/14',
-      '46' => '*/15',
-      '1' => '1',
-      '2' => '2',
-      '3' => '3',
-      '4' => '4',
-      '5' => '5',
-      '6' => '6',
-      '7' => '7',
-      '8' => '8',
-      '9' => '9',
-      '10' => '10',
-      '11' => '11',
-      '12' => '12',
-      '13' => '13',
-      '14' => '14',
-      '15' => '15',
-      '16' => '16',
-      '17' => '17',
-      '18' => '18',
-      '19' => '19',
-      '20' => '20',
-      '21' => '21',
-      '22' => '22',
-      '23' => '23',
-      '24' => '24',
-      '25' => '25',
-      '26' => '26',
-      '27' => '27',
-      '28' => '28',
-      '29' => '29',
-      '30' => '30',
-      '31' => '31'  
-    ),
-    '#default_value' => $easycron_settings['day'],
-    '#description' => t("Day interval or exact day."),
-    '#required' => TRUE,
-  );
-  
-  $form['easycron_month'] = array(
-    '#type' => 'select',
-    '#title' => t('Month'),
-    '#options' => array(
-      '13' => '*',
-      '14' => '*/2',
-      '15' => '*/3',
-      '16' => '*/4',
-      '17' => '*/5',
-      '18' => '*/6',
-      '1' => '1',
-      '2' => '2',
-      '3' => '3',
-      '4' => '4',
-      '5' => '5',
-      '6' => '6',
-      '7' => '7',
-      '8' => '8',
-      '9' => '9',
-      '10' => '10',
-      '11' => '11',
-      '12' => '12'  
-    ),
-    '#default_value' => $easycron_settings['month'],
-    '#description' => t("Month interval or exact month."),
-    '#required' => TRUE,
-  );
-  
-  $form['easycron_weekday'] = array(
-    '#type' => 'select',
-    '#title' => t('Weekday'),
-    '#options' => array(
-      '8' => '*',
-      '1' => t('Mon'),
-      '2' => t('Tue'),
-      '3' => t('Wed'),
-      '4' => t('Thu'),
-      '5' => t('Fri'),
-      '6' => t('Sat'),
-      '7' => t('Sun')  
-    ),
-    '#default_value' => $easycron_settings['weekday'],
-    '#description' => t("Exact weekday."),
-    '#required' => TRUE,
-  );  
-  
-  $form['easycron_email_me'] = array(
-    '#type' => 'select',
-    '#title' => t('Email me'),
-    '#options' => array(
-      '0' => t('never'),
-      '1' => t('if execution fails'),
-      '2' => t('after execution')  
-    ),
-    '#default_value' => $easycron_settings['email_me'],
-    '#description' => t("Email me."),
-    '#required' => TRUE,
-  );
-
-  $form['easycron_log_output_length'] = array(
-    '#type' => 'select',
-    '#title' => t('Log output'),
-    '#options' => array(
-      '0' => t('No'),
-      '10240' => t('Yes')  
-    ),
-    '#default_value' => $easycron_settings['log_output_length'],
-    '#description' => t("Log webcron job's output (You can check the output on easycron.com)."),
-    '#required' => TRUE,
-  );
-
-  return system_settings_form($form);
-}
-
-function easycron_connect($action, $easycron_settings) {
-  $settings_array = array();  
-  foreach ($easycron_settings as $key => $value) {
-    $settings_array[] = $key . '=' . urlencode($value);
-  }
-  $settings_str = implode('&', $settings_array);
-  $url = 'http://www.easycron.com/api/' . $action . '?' . $settings_str;
-  $result = drupal_http_request($url, array(), 'GET', NULL, 3);
-    
-  if ($result->code != 200) {
-    form_set_error('', t('Cannot connect to easycron.com.'));
-  } 
-  else {
-    $data = unserialize($result->data);
-    if ($data['status'] == '0') {
-      // setting validation failed
-      return $data['notices'];
-    }
-    else {
-      // successfully made the settings
-      return TRUE;
-    }
-  }
-}
-
-function easycron_admin_validate($form, &$form_state) {
-  if (strlen($form['easycron_token']['#value']) != 32) {
-    form_set_error('easycron_token', t('The API token should be 32 characters\' long.'));
-  }
-  if (!form_get_errors()) {
-    $easycron_settings = array(
-      'token' => $form['easycron_token']['#value'],
-      'minute' => $form['easycron_minute']['#value'],
-      'hour' => $form['easycron_hour']['#value'],
-      'day' => $form['easycron_day']['#value'],
-      'month' => $form['easycron_month']['#value'],
-      'weekday' => $form['easycron_weekday']['#value'],
-      'email_me' => $form['easycron_email_me']['#value'],
-      'log_output_length' => $form['easycron_log_output_length']['#value'],
-      'status' => $form['easycron_status']['#value'],
-      'url' => 'http://' . variable_get('site_name', '') . '/cron.php',
-      'module_type' => 'Drupal',
-    );
-    $result = easycron_connect('makesettings', $easycron_settings);
-    if ($result !== TRUE) {
-      $notice_text = array(
-        'wrong_api_token' => t('The API token is wrong. Please check it on easycron.com.'),
-        'name_too_long' => t('Your cron job name is too long.'),
-        'minute_field_invalid' => t('The value of minute field is invalid.'),
-        'hour_field_invalid' => t('The value of hour field is invalid.'),
-        'day_field_invalid' => t('The value of day field is invalid.'),
-        'month_field_invalid' => t('The value of month field is invalid.'),
-        'weekday_field_invalid' => t('The value of weekday field is not valid.'),
-        'log_output_field_invalid' => t('The value of "log output" field is not valid.'),
-        'email_me_field_invalid' => t('The value of "email me" field is not valid.'),
-        'email_me_privilege_not_enough' => t('You don\'t have enough privilege to enable the "Email me" feature. You need to upgrade your plan on easycron.com to a premium plan to remove the limit.'),
-        'log_output_privilege_not_enough' => t('You don\'t have enough privilege to enable the "log output" feature. You can upgrade your plan on easycron.com to a premium plan to remove the limit.'),
-        'interval_too_short' => t('The execution interval cannot be lower than @minimum_interval minutes. You can upgrade your plan on easycron.com to a premium plan to remove the limit.', array('@minimum_interval' => (isset($result['minimum_interval']) ? $result['minimum_interval'] : '1'))),
-        'url_wrong' => t('The URL format is wrong.'),
-        'domain_prohibited' => t('The domain is prohibited to be added.'),
-        'url_invalid_or_timeout' => t('The URL you entered is invalid or timeout happened when we trying to connect it.'),
-        'moved_permanently' => t('HTTP/1.1 301 Moved Permanently'),
-        '302_found' => t('HTTP/1.1 302 Found'),
-        '401_unauthorized' => t('HTTP/1.1 401 Unauthorized'),
-        '403_forbidden' => t('HTTP/1.1 403 Forbidden'),
-        '404_notfound' => t('HTTP/1.1 404 Not Found'),
-        'timeout' => t('Connection or Transfer Timeout'),
-        'unrecognized_error' => t('Unrecognized Error'),
-        'coin_not_enough' => t('You don\'t have enough coin to create the cron job. Please buy more coin on easycron.com to proceed.'),
-        'unexpected_error_occured' => t('unexpected error occured'),
-      );
-      if (isset($result['minimum_interval'])) {
-        unset($result['minimum_interval']);
-      }
-      $notices = array();
-      foreach ($result as $value) {
-        $notices[] = $notice_text[$value];
-      }
-      form_set_error('', implode('<br>', $notices));
-    }
-  }
-}
-
 /**
  * Implements hook_menu().
  */
 function easycron_menu() {
-
   $items = array();
 
   $items['admin/settings/easycron'] = array(
@@ -418,6 +36,7 @@ function easycron_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('easycron_admin'),
     'access arguments' => array('access administration pages'),
+    'file' => 'easycron.admin.inc',
     'type' => MENU_NORMAL_ITEM,
    );
 
