diff --git a/boost_expire.module b/boost_expire.module
index 49ec5b4..d17aee3 100644
--- a/boost_expire.module
+++ b/boost_expire.module
@@ -2,21 +2,20 @@
 
 /**
  * @file
- *
  * Expires Boost caches automatically when certain Drupal actions are taken.
  * Add a Drupal block to expire boost cache
  * on the entire site or on the current page
  */
 
 /**
- * Implements hook_permission()
+ * Implements hook_permission().
  */
 function boost_expire_permission() {
   return array(
-  'clear boost cache' => array(
-  'title' => t('Clear the boost module cache'),
-  'description' => t('Allow users to clear the boost module cache'),
-  ),
+    'clear boost cache' => array(
+      'title' => t('Clear the boost module cache'),
+      'description' => t('Allow users to clear the boost module cache'),
+    ),
   );
 }
 
@@ -25,20 +24,20 @@ function boost_expire_permission() {
  */
 function boost_expire_menu() {
   $items['clear_boost_cache/all'] = array(
-'title' => 'Boost : Cache Management',
-'page callback' => 'boost_expire_clear_cache',
-'access callback' => 'user_access',
-'access arguments' => array('clear boost cache'),
-'type' => MENU_CALLBACK,
+    'title' => 'Boost : Cache Management',
+    'page callback' => 'boost_expire_clear_cache',
+    'access callback' => 'user_access',
+    'access arguments' => array('clear boost cache'),
+    'type' => MENU_CALLBACK,
   );
 
   $items['clear_boost_cache/%'] = array(
-'title' => 'Boost : Cache Management',
-'page callback' => 'boost_expire_clear_cache',
-'page arguments' => array(1),
-'access callback' => 'user_access',
-'access arguments' => array('clear boost cache'),
-'type' => MENU_CALLBACK,
+    'title' => 'Boost : Cache Management',
+    'page callback' => 'boost_expire_clear_cache',
+    'page arguments' => array(1),
+    'access callback' => 'user_access',
+    'access arguments' => array('clear boost cache'),
+    'type' => MENU_CALLBACK,
   );
   return $items;
 }
@@ -46,20 +45,20 @@ function boost_expire_menu() {
 /**
  * Page callback.
  */
-function boost_expire_clear_cache($arg= '') {
+function boost_expire_clear_cache($arg = '') {
 
-  // Delete clear_boost_cache/ in the current_path() string
+  // Delete clear_boost_cache/ in the current_path() string.
   $patterns = '/clear_boost_cache\//';
   $replacements = '';
-  $path_to_clear =  preg_replace($patterns, $replacements, current_path());
+  $path_to_clear = preg_replace($patterns, $replacements, current_path());
 
-  if ( $arg == '' ) {
+  if ($arg == '') {
     $result = boost_expire_flush_boost_cache(array('scope' => 'all'));
-    return drupal_set_message( t('Boost cache cleared') );
+    return drupal_set_message(t('Boost cache cleared'));
   }
   else {
     $result = boost_expire_flush_boost_cache(array('scope' => $path_to_clear));
-    return drupal_set_message( t('Current page boost cache cleared') );
+    return drupal_set_message(t('Current page boost cache cleared'));
   }
 }
 
@@ -76,7 +75,7 @@ function boost_expire_block_info() {
 /**
  * Implements hook_block_view().
  */
-function boost_expire_block_view($delta='') {
+function boost_expire_block_view($delta = '') {
   $block = array();
   switch ($delta) {
     case 'boost-clear-cache':
@@ -90,18 +89,19 @@ function boost_expire_block_view($delta='') {
 }
 
 /**
- * boost_expire block content function.
+ * Boost_expire block content function.
  */
 function boost_expire_block_contents($delta) {
   switch ($delta) {
     case 'boost-clear-cache':
       $items['items'] = array(
-      l(t('Clear all Boost module cache') , 'clear_boost_cache/all'),
-      l(t('Clear Boost module cache for this page') , 'clear_boost_cache/' . current_path()),
+        l(t('Clear all Boost module cache'), 'clear_boost_cache/all'),
+        l(t('Clear Boost module cache for this page'), 'clear_boost_cache/' . current_path()),
       );
       $content = theme('item_list', $items);
       return array('#markup' => $content);
-      break;
+
+    break;
   }
 }
 
@@ -116,35 +116,36 @@ function boost_expire_node_insert($node) {
  * Implements hook_node_update().
  */
 function boost_expire_node_update($node) {
-  boost_expire_flush_boost_cache(array('scope' => 'node/' . $node->nid ));
+  boost_expire_flush_boost_cache(array('scope' => 'node/' . $node->nid));
 }
 
 /**
  * Implements hook_comment_insert().
  */
 function boost_expire_comment_insert($node) {
-  boost_expire_flush_boost_cache(array('scope' => 'node/' . $node->nid ));
+  boost_expire_flush_boost_cache(array('scope' => 'node/' . $node->nid));
 }
 
 /**
  * Implements hook_comment_update().
  */
 function boost_expire_comment_update($node) {
-  boost_expire_flush_boost_cache(array('scope' => 'node/' . $node->nid ));
+  boost_expire_flush_boost_cache(array('scope' => 'node/' . $node->nid));
 }
 
 /**
  * Function to clear Boost's cache.
  *
  * At this time, this is a pretty stupid function, but that's because there are
- * no easy ways to expire certain parts of the Boost cache, while Boost is still
- * in development for Drupal 7. But it does it's job.
+ * no easy ways to expire certain parts of the Boost cache, while Boost is
+ * still in development for Drupal 7. But it does it's job.
  *
- * Clearing the entire Boost cache every time a comment is saved/updated, a node
- * is saved/updated, etc. is definitely not ideal, but it's better than having
- * to constantly hit the 'clear all caches' button or wait for cron expiration.
+ * Clearing the entire Boost cache every time a comment is saved/updated, a
+ * node is saved/updated, etc. is definitely not ideal, but it's better than
+ * having to constantly hit the 'clear all caches' button or wait for cron
+ * expiration.
  *
- * @param $options
+ * @param array $options
  *   Associative array of options for this flush. Currently, only supported
  *   option is 'scope' => 'all'.
  */
@@ -152,7 +153,7 @@ function boost_expire_flush_boost_cache($options = array()) {
   global $_boost, $base_path, $base_root;
 
   // Borrow some logic from boost_htaccess_cache_dir_put() to build our base
-  // directory path
+  // directory path.
   if (empty($_boost['base_dir'])) {
     $url = $base_root . request_uri();
     $parts = parse_url($url);
@@ -164,19 +165,20 @@ function boost_expire_flush_boost_cache($options = array()) {
   if (!empty($options['scope']) && $options['scope'] == 'all') {
     if (isset($_boost['base_dir'])) {
       $count = _boost_rmdir($_boost['base_dir'], TRUE);
-      // TODO - Maybe set an option to allow enabling message in the future.
-      if ( variable_get('boost_message_debug', BOOST_MESSAGE_DEBUG) && $count != 0 ) {
+      // @TODO : Maybe set an option to allow enabling message in the future.
+      if (variable_get('boost_message_debug', BOOST_MESSAGE_DEBUG) && $count != 0) {
         watchdog('boost_expire', 'Flushed all files (%count) from static page cache.', array('%count' => $count), WATCHDOG_NOTICE);
       }
     }
   }
   // Clear cache for the current Drupal page
-  // Watchdog notification config in boost module : cf. admin/config/system/boost/debug
-  elseif  (!empty($options['scope']) && $options['scope'] != 'all') {
+  // Watchdog notification config in boost module:
+  // cf. admin/config/system/boost/debug
+  elseif (!empty($options['scope']) && $options['scope'] != 'all') {
     if (isset($_boost['base_dir'])) {
-      $count = boost_expire_flush_boost_page($_boost['base_dir'] , $options['scope']);
+      $count = boost_expire_flush_boost_page($_boost['base_dir'], $options['scope']);
 
-      if ( variable_get('boost_message_debug', BOOST_MESSAGE_DEBUG) and $count != 0 ) {
+      if (variable_get('boost_message_debug', BOOST_MESSAGE_DEBUG) and $count != 0) {
         watchdog('boost_expire', 'Flushed one page (%count) from static page cache.', array('%count' => $count), WATCHDOG_NOTICE);
       }
     }
@@ -185,27 +187,28 @@ function boost_expire_flush_boost_cache($options = array()) {
 }
 
 /**
- * Function to clear the current Drupal page
- * @param $base_dir
+ * Function to clear the current Drupal page.
+ *
+ * @param object $base_dir
  *   url of root directory for boost
- * @param $page
+ * @param object $page
  *   url of the current page
  */
 function boost_expire_flush_boost_page($base_dir, $page) {
 
   // @TODO : $page doesn't work with url like node?page=1
-  // Front page
+  // Front page.
   $result = 0;
   if ($page == 'node') {
     $file_to_del = $base_dir . '_.html';
   }
-  // Node page
+  // Node page.
   else {
     $file_to_del = $base_dir . $page . '_.html';
   }
 
   if (file_exists($file_to_del)) {
-    $result = unlink($file_to_del);
+    $result = domxml_unlink_node($file_to_del);
   }
   return $result;
 }
