diff --git a/phpexcel.inc b/phpexcel.inc
index f319cd5..94263d1 100755
--- a/phpexcel.inc
+++ b/phpexcel.inc
@@ -49,46 +49,35 @@ function phpexcel_export($headers = array(), $data = array(), $path = '', $optio
       $headers
     ) && (!isset($options['ignore_headers']) || (isset($options['ignore_headers']) && !$options['ignore_headers']))
   ) {
-    watchdog(
-      'phpexcel',
-      "No header was provided, and the 'ignore_headers' option was not set to TRUE. Excel export aborted.",
-      array(),
-      WATCHDOG_ERROR
-    );
-
+    \Drupal::logger('phpecel')->error("No header was provided, and the 'ignore_headers' option was not set to TRUE. Excel export aborted.");
     return PHPEXCEL_ERROR_NO_HEADERS;
   }
 
   if (!count($data)) {
-    watchdog('phpexcel', "No data was provided. Excel export aborted.", array(), WATCHDOG_ERROR);
-
+    \Drupal::logger('phpecel')->error("No data was provided. Excel export aborted.");
     return PHPEXCEL_ERROR_NO_DATA;
   }
 
   if (!(is_writable($path) || (!file_exists($path) && is_writable(dirname($path))))) {
-    watchdog(
-      'phpexcel',
-      "Path '@path' is not writable. Excel export aborted.",
-      array('@path' => $path),
-      WATCHDOG_ERROR
-    );
-
+    \Drupal::logger('phpecel')->error("Path '@path' is not writable. Excel export aborted.", array('@path' => $path));
     return PHPEXCEL_ERROR_PATH_NOT_WRITABLE;
   }
 
   $library = libraries_load('PHPExcel');
 
   if (empty($library['loaded'])) {
-    watchdog('phpexcel', "Couldn't find the PHPExcel library. Excel export aborted.", array(), WATCHDOG_ERROR);
-
+    \Drupal::logger('phpecel')->error("Couldn't find the PHPExcel library. Excel export aborted.");
     return PHPEXCEL_ERROR_LIBRARY_NOT_FOUND;
   }
 
   $path = phpexcel_munge_filename($path);
+  
+  //Loading settings Settings variables
+  $phpexcel_settings = \Drupal::config('phpexcel.settings');
 
   // Determine caching method.
   $cache_settings = array();
-  switch (variable_get('phpexcel_cache_mechanism')) {
+  switch ($phpexcel_settings->get('cache_mechanism')) {
     case 'cache_in_memory_serialized':
       $cache_method = PHPExcel_CachedObjectStorageFactory::cache_in_memory_serialized;
       break;
@@ -100,23 +89,23 @@ function phpexcel_export($headers = array(), $data = array(), $path = '', $optio
     case 'cache_to_phpTemp':
       $cache_method = PHPExcel_CachedObjectStorageFactory::cache_to_phpTemp;
       $cache_settings = array(
-        'memoryCacheSize' => variable_get('phpexcel_phptemp_limit', 1) . 'MB'
+        'memoryCacheSize' => $phpexcel_settings->get('phptemp_limit') . 'MB'
       );
       break;
 
     case 'cache_to_apc':
       $cache_method = PHPExcel_CachedObjectStorageFactory::cache_to_apc;
       $cache_settings = array(
-        'cacheTime' => variable_get('phpexcel_apc_cachetime', '600')
+        'cacheTime' => $phpexcel_settings->get('apc_cachetime')
       );
       break;
 
     case 'cache_to_memcache':
       $cache_method = PHPExcel_CachedObjectStorageFactory::cache_to_memcache;
       $cache_settings = array(
-        'memcacheServer' => variable_get('phpexcel_memcache_host', 'localhost'),
-        'memcachePort' => variable_get('phpexcel_memcache_port', '11211'),
-        'cacheTime' => variable_get('phpexcel_memcache_cachetime', '600')
+        'memcacheServer' => $phpexcel_settings->get('memcache_host'),
+        'memcachePort' => $phpexcel_settings->get('_memcache_port'),
+        'cacheTime' => $phpexcel_settings->get('memcache_cachetime')
       );
       break;
 
@@ -254,12 +243,11 @@ function _phpexcel_set_headers($xls, &$headers, $options) {
       // PHPExcel always creates one sheet.
       $sheet = $xls->getSheet();
     }
-
     if (!is_numeric($sheet_name)) {
-      $sheet->setTitle($sheet_name);
+      $sheet->setTitle(str_replace("Worksheet !id", '!id' , ($sheet_id + 1)));
     }
     else {
-      $sheet->setTitle(t("Worksheet !id", array('!id' => ($sheet_id + 1))));
+      $sheet->setTitle("test");
     }
 
     phpexcel_invoke('export', 'new sheet', $sheet_id, $xls, $options);
@@ -478,13 +466,13 @@ function phpexcel_import($path, $keyed_by_headers = TRUE, $keyed_by_worksheet =
       return $data;
     }
     else {
-      watchdog('phpexcel', "Couldn't find the PHPExcel library. Excel import aborted.", array(), WATCHDOG_ERROR);
+      \Drupal::logger('phpecel')->error("Couldn't find the PHPExcel library. Excel import aborted.");
 
       return PHPEXCEL_ERROR_LIBRARY_NOT_FOUND;
     }
   }
   else {
-    watchdog('phpexcel', "The path '@path' is not readable. Excel import aborted.", array('@path' => $path));
+    \Drupal::logger('phpecel')->error("The path '@path' is not readable. Excel import aborted.", array('@path' => $path));
 
     return PHPEXCEL_ERROR_FILE_NOT_READABLE;
   }
@@ -496,7 +484,8 @@ function phpexcel_import($path, $keyed_by_headers = TRUE, $keyed_by_worksheet =
  * reference.
  */
 function phpexcel_invoke($hook, $op, &$data, $phpexcel, $options, $column = NULL, $row = NULL) {
-  foreach (module_implements('phpexcel_' . $hook) as $module) {
+  $module_handler = \Drupal::moduleHandler();
+  foreach ($module_handler->getImplementations('phpexcel_' + $hook) as $module) {
     $function = $module . '_phpexcel_' . $hook;
 
     $function($op, $data, $phpexcel, $options, $column, $row);
