diff --git a/audio.field.inc b/audio.field.inc
index d218fc3..7b091af 100644
--- a/audio.field.inc
+++ b/audio.field.inc
@@ -5,168 +5,23 @@
  */
 
 /**
- * Implements hook_field_prepare_view().
- */
-function audiofield_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &$items) {
-  //TODO: Check this:
-  //  Remove files specified to not be displayed.
-  foreach ($entities as $id => $entity) {
-    foreach ($items[$id] as $delta => $item) {
-      if (!file_field_displayed($item, $field)) {
-        unset($items[$id][$delta]);
-      }
-      // Ensure consecutive deltas.
-      $items[$id] = array_values($items[$id]);
-    }
-  }
-}
-
-/**
- * Implements hook_field_is_empty().
- */
-function audiofield_field_is_empty($item, $field) {
-  return file_field_is_empty($item, $field);
-}
-
-/**
- * Implements hook_field_widget_info().
- */
-function audiofield_field_widget_info() {
-  return array(
-    'audiofield_widget' => array(
-      'label' => t('Audio Upload'),
-      'field types' => array('file'),
-      'settings' => array(
-        'progress_indicator' => 'throbber',
-        //'file_extensions' => 'mp3',
-      ),
-      'behaviors' => array(
-        'multiple values' => FIELD_BEHAVIOR_CUSTOM,
-        'default value' => FIELD_BEHAVIOR_NONE,
-      ),
-    ),
-  );
-}
-
-/**
- * Implements hook_field_widget_form().
- */
-function audiofield_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
-
-  // Add display_field setting to field because file_field_widget_form() assumes it is set.
-  $field['settings']['display_field'] = 0;
-
-  $elements = file_field_widget_form($form, $form_state, $field, $instance, $langcode, $items, $delta, $element);
-  $settings = $instance['settings'];
-
-  foreach (element_children($elements) as $delta) {
-    $elements[$delta]['#process'] = array('audiofield_field_widget_process');
-  }
-  if ($field['cardinality'] == 1) {
-    // If there's only one field, return it as delta 0.
-    if (empty($elements[0]['#default_value']['fid'])) {
-      $elements[0]['#description'] = theme('file_upload_help', array(
-        'description' => $instance['description'],
-        'upload_validators' => $elements[0]['#upload_validators']
-      ));
-    }
-  }
-  else {
-    $elements['#file_upload_description'] = theme('file_upload_help', array('upload_validators' => $elements[0]['#upload_validators']));
-  }
-
-  return $elements;
-}
-
-/**
- * An element #process callback for the audiofield_widget field type.
- *
- * Display audio player in node edit mode
- */
-function audiofield_field_widget_process($element, &$form_state, $form) {
-  $fid = isset($element['#value']['fid']) ? $element['#value']['fid'] : 0;
-  $element = file_managed_file_process($element, $form_state, $form);
-  
-  $item = $element['#value'];
-  $item['fid'] = $element['fid']['#value'];
-  $field = field_widget_field($element, $form_state);
-  $instance = field_widget_instance($element, $form_state);
-   // Add the display field if enabled.
-  if (!empty($field['settings']['display_field']) && $item['fid']) {
-    $element['display'] = array(
-      '#type' => empty($item['fid']) ? 'hidden' : 'checkbox',
-      '#title' => t('Include file in display'),
-      '#value' => isset($item['display']) ? $item['display'] : $field['settings']['display_default'],
-      '#attributes' => array('class' => array('file-display')),
-    );
-  }
-  else {
-    $element['display'] = array(
-      '#type' => 'hidden',
-      '#value' => '1',
-    );
-  }
-  if ($fid && $element['#file']) {
-    $audiofile = file_create_url($element['#file']->uri);
-    $info = pathinfo($audiofile);
-    $op = $info['extension'];
-    $element['filename'] = array(
-      '#type' => 'markup',
-      '#markup' => audiofield_get_player($audiofile, $op),
-      '#weight' => -10,
-    );
-  }
-  
-  // Add the description field if enabled.
-  if (!empty($instance['settings']['description_field']) && $item['fid']) {
-    $element['description'] = array(
-      '#type' => 'textfield',
-      '#title' => t('Description'),
-      '#value' => isset($item['description']) ? $item['description'] : '',
-      '#type' => variable_get('file_description_type', 'textfield'),
-      '#maxlength' => variable_get('file_description_length', 128),
-      '#description' => t('The description may be used as the label of the link to the file.'),
-    );
-  }
-  return $element;
-}
-
-/**
- * Implements hook_field_formatter_info().
- */
-function audiofield_field_formatter_info() {
-  $formatters = array(
-    'audiofield_embedded' => array(
-      'label' => t('Audio player with download'),
-      'field types' => array('file'),
-      'description' => t('Displays an audio player and optional download link.'),
-    ),
-    'audiofield_nodownload' => array(
-      'label' => t('Audio player only'),
-      'field types' => array('file'),
-      'description' => t('Displays only an audio player.'),
-    ),
-  );
-
-  return $formatters;
-}
-
-/**
  * Implements hook_field_formatter_view().
-TODO: Can implement playlists to group audios hold in multiple valued fields
+ *
+ * TODO: Can implement playlists to group audios hold in multiple valued fields
  */
 function audiofield_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
   $elements = array();
 
   switch ($display['type']) {
-    case 'audiofield_embedded' :
+    case 'audiofield_embedded':
       foreach ($items as $delta => $item) {
-        $elements[] = array('#markup' => theme('audiofield_formatter_audiofield_embedded', array('file' => (object) $item)));
+        $elements[] = array('#markup' => _theme('audiofield_formatter_audiofield_embedded', array('file' => (object) $item)));
       }
       break;
+
     case 'audiofield_nodownload':
       foreach ($items as $delta => $item) {
-        $elements[] = array('#markup' => theme('audiofield_formatter_audiofield_nodownload', array('file' => (object) $item)));
+        $elements[] = array('#markup' => _theme('audiofield_formatter_audiofield_nodownload', array('file' => (object) $item)));
       }
       break;
   }
diff --git a/audiofield.module b/audiofield.module
index ce8dabe..28e4633 100644
--- a/audiofield.module
+++ b/audiofield.module
@@ -5,19 +5,6 @@ module_load_include('inc', 'audiofield', 'audio.field');
 module_load_include('inc', 'audiofield', 'audiofield.players');
 
 /**
- * Implementation of hook_menu().
- */
-function audiofield_menu() {
-  $items['admin/config/media/audiofield'] = array(
-    'title' => 'Audio Field',
-    'description' => 'Configure Audiofield.',
-    'route_name' => 'audiofield_settings',
-    'type' => MENU_NORMAL_ITEM,
-  );
-  return $items;
-}
-
-/**
  * Implementation of hook_permission().
  */
 function audiofield_permission() {
@@ -40,11 +27,20 @@ function audiofield_theme() {
   $theme = array(
     // Themes for the formatters.
     'audiofield_formatter_audiofield_embedded' => array(
-      'variables' => array('file' => NULL),
+      'variables' => array(
+        'item' => NULL,
+        'item_attributes' => NULL,
+        'path' => NULL,
+        '#extensions' => NULL,
+      ),
       'file' => 'audiofield_formatter.inc',
     ),
     'audiofield_formatter_audiofield_nodownload' => array(
-      'variables' => array('file' => NULL),
+      'variables' => array(
+        'item' => NULL,
+        'item_attributes' => NULL,
+        'path' => NULL,
+      ),
       'file' => 'audiofield_formatter.inc',
     ),
   );
@@ -53,15 +49,18 @@ function audiofield_theme() {
 }
 
 /**
- * Get the object for the suitable player for the parameter resource
+ * Get the object for the suitable player for the parameter resource.
  */
 function audiofield_get_player($audio_url, $op) {
+  $config = \Drupal::config('audiofield.settings');
+
   global $base_path;
-  //Lets convert $op to lowercase
+
   $op = strtolower($op);
   $audio_players = audiofield_players();
   $variable_name = 'audiofield_audioplayer' . ($op == 'mp3' ? '' : "_$op");
-  $player_id = variable_get($variable_name, '');
+  $player_id = $config->get($variable_name);
+
   $player = isset($audio_players[$player_id]) ? $audio_players[$player_id] : NULL;
   if (empty($player)) {
     return audiofield_embeddedplayer($audio_url);
@@ -69,41 +68,3 @@ function audiofield_get_player($audio_url, $op) {
   return call_user_func($player['callback'], $base_path . $player['path'], $audio_url);
 }
 
-/**
- * Implements hook_form_FORM_ID_alter().
- */
-function audiofield_form_field_ui_field_edit_form_alter(&$form, &$form_state) {
-  $instance = $form['#instance'];
-
-  if ($instance['widget']['type'] == 'audiofield_widget' && $form['instance']['settings']['file_extensions']['#default_value'] == 'txt') {
-    $form['instance']['settings']['file_extensions']['#default_value'] = 'mp3';
-  }
-}
-
-/**
- * Implementation of hook_form_[form_id]_alter().
- *
- * Modify the add new field form to change the default formatter.
- */
-function audiofield_form_field_ui_field_settings_form_alter(&$form, &$form_state) {
-  $form['#submit'][] = 'audiofield_form_content_field_overview_submit';
-}
-
-/**
- * Submit handler to set a new field's formatter to "audiofield_embedded".
- */
-function audiofield_form_content_field_overview_submit(&$form, &$form_state) {
-  $entity_type = 'node';
-  $field_name = $form_state['values']['field']['field_name'];
-  $bundle = $form_state['complete form']['#bundle'];
-  $instance = field_read_instance($entity_type, $field_name, $bundle);
-
-  if ($instance['widget']['module'] == 'audiofield') {
-    foreach ($instance['display'] as $display_type => $display_settings) {
-      if ($instance['display'][$display_type]['type'] == 'file_default') {
-        $instance['display'][$display_type]['type'] = 'audiofield_embedded';
-      }
-    }
-    field_update_instance($instance);
-  }
-}
diff --git a/audiofield.players.inc b/audiofield.players.inc
index 8dfb8b1..3c1014a 100644
--- a/audiofield.players.inc
+++ b/audiofield.players.inc
@@ -5,8 +5,10 @@
 function audiofield_players() {
   $players = module_invoke_all('audiofield_players');
 
+//  $dir = \Drupal::config('audiofield.settings')->get('audiofield_players_dir');
+
   $players['wpaudioplayer'] = array(
-    'path' => variable_get('audiofield_players_dir', 'sites/all/libraries/player') . "/audio-player/player.swf",
+    'path' => \Drupal::config('audiofield.settings')->get('audiofield_players_dir') . "/audio-player/player.swf",
     'name' => 'WordPress Audio Player',
     'download_link' => 'http://wpaudioplayer.com/download',
     'filetypes' => array('mp3'),
@@ -14,7 +16,7 @@ function audiofield_players() {
   );
 
   $players['xspf_slim'] = array(
-    'path' => variable_get('audiofield_players_dir', 'sites/all/libraries/player') . "/xspf_player_slim.swf",
+    'path' => \Drupal::config('audiofield.settings')->get('audiofield_players_dir') . "/xspf_player_slim.swf",
     'name' => 'XSPF Slim Player',
     'download_link' => 'http://prdownloads.sourceforge.net/musicplayer/xspf_player_slim-correct-0.2.3.zip?download',
     'filetypes' => array('mp3'),
@@ -22,7 +24,7 @@ function audiofield_players() {
   );
 
   $players['xspf_button'] = array(
-    'path' => variable_get('audiofield_players_dir', 'sites/all/libraries/player') . "/button/musicplayer.swf",
+    'path' => \Drupal::config('audiofield.settings')->get('audiofield_players_dir') . "/button/musicplayer.swf",
     'name' => 'XSPF Button Player',
     'download_link' => 'http://prdownloads.sourceforge.net/musicplayer/button_player-0.1.zip?download',
     'filetypes' => array('mp3'),
@@ -31,7 +33,8 @@ function audiofield_players() {
 
   //#1414398: Premium Beat players no longer available
   $players['premium_beat_single_track'] = array(
-    'path' => variable_get('audiofield_players_dir', 'sites/all/libraries/player') . "/playerSinglePackage/playerSingle.swf",
+    'path' => \Drupal::config('audiofield.settings')
+        ->get('audiofield_players_dir') . "/playerSinglePackage/playerSingle.swf",
     'name' => 'Premium Beat Single Player',
     //'download_link' => 'http://www.premiumbeat.com/flash_resources/free_flash_music_player/single_track_flash_mp3_player.php',
     'filetypes' => array('mp3'),
@@ -39,7 +42,7 @@ function audiofield_players() {
   );
 
   $players['premium_beat_thin'] = array(
-    'path' => variable_get('audiofield_players_dir', 'sites/all/libraries/player') . "/OriginalThinMusicPlayer.swf",
+    'path' => \Drupal::config('audiofield.settings')->get('audiofield_players_dir') . "/OriginalThinMusicPlayer.swf",
     'name' => 'Premium Beat Thin Player',
     //'download_link' => 'http://www.premiumbeat.com/flash_music_players/original/thin/',
     'filetypes' => array('mp3'),
@@ -47,7 +50,7 @@ function audiofield_players() {
   );
 
   $players['premium_beat_mini'] = array(
-    'path' => variable_get('audiofield_players_dir', 'sites/all/libraries/player') . "/LWMusicPlayer.swf",
+    'path' => \Drupal::config('audiofield.settings')->get('audiofield_players_dir') . "/LWMusicPlayer.swf",
     'name' => 'Premium Beat Mini Player',
     //'download_link' => 'http://www.premiumbeat.com/flash_music_players/original/mini/',
     'filetypes' => array('mp3'),
@@ -66,7 +69,7 @@ function audiofield_players() {
 
   if (module_exists('mediaelement')) {
     $players['mediaelement'] = array(
-      'path' =>  'sites/all/libraries/mediaelement/build/mediaelement.js',
+      'path' => 'sites/all/libraries/mediaelement/build/mediaelement.js',
       'name' => 'Mediaelement',
       'download_link' => 'http://mediaelementjs.com',
       'filetypes' => array('mp3'),
@@ -75,7 +78,7 @@ function audiofield_players() {
   }
 
   $players['soundmanager2'] = array(
-    'path' => variable_get('audiofield_players_dir', 'sites/all/libraries/player') . "/soundmanager2",
+    'path' => \Drupal::config('audiofield.settings')->get('audiofield_players_dir') . "/soundmanager2",
     'name' => 'SoundManager2 360',
     'download_link' => 'http://www.schillmania.com/projects/soundmanager2/',
     'filetypes' => array('mp3', 'wav'),
@@ -91,27 +94,20 @@ function audiofield_players() {
   );
 
   $players['jplayer'] = array(
-    'path' => variable_get('audiofield_players_dir', 'sites/all/libraries/player') . "/jplayer/jquery.jplayer.min.js",
-    'css' => variable_get('audiofield_players_dir', 'sites/all/libraries/player') . "/jplayer/jplayer.css",
+    'path' => \Drupal::config('audiofield.settings')->get('audiofield_players_dir') . "/jplayer/jquery.jplayer.min.js",
+    'css' => \Drupal::config('audiofield.settings')->get('audiofield_players_dir') . "/jplayer/jplayer.css",
     'name' => 'jPlayer',
     'download_link' => 'http://www.jplayer.org/download/',
     'filetypes' => array('mp3'),
     'callback' => 'audiofield_jplayer',
   );
 
-  /*
-   $players['jplayer_module']=array(
-       'path' => '',
-       'name' => 'jPlayer Module',
-       'download_link' => 'http://drupal.org/project/jplayer',
-       'filetypes' => array('mp3', 'm4a', 'oga', 'webma', 'wav'),
-       'callback' => 'audiofield_jplayer_module',
-     );
-   */
-
   return $players;
 }
 
+/**
+ * Helper function return theme.
+ */
 function _audiofield_theme() {
   return array(
     // Themes for the players.
@@ -139,20 +135,27 @@ function _audiofield_theme() {
   );
 }
 
-/* Audio Callback Functions */
-
+/**
+ * Audio Callback Functions.
+ */
 function audiofield_embeddedplayer($audio_file) {
-  return '<embed height="15" src="' . $audio_file . '" autostart="false"></embed>';
+  return '<embed height="70" src="' . $audio_file . '" autostart="false"></embed>';
 }
 
+/**
+ * Audio Callback Functions.
+ */
 function audiofield_wpaudioplayer($player_path, $audio_file) {
   $variables = array(
     'player_path' => $player_path,
     'audio_file' => $audio_file,
   );
-  return theme('audiofield_players_wpaudioplayer', $variables);
+  return _theme('audiofield_players_wpaudioplayer', $variables);
 }
 
+/**
+ * Audio Callback Functions.
+ */
 function theme_audiofield_players_wpaudioplayer($variables) {
   $player_path = $variables['player_path'];
   $audio_file = $variables['audio_file'];
@@ -165,14 +168,20 @@ function theme_audiofield_players_wpaudioplayer($variables) {
                           </object>';
 }
 
+/**
+ * Audio Callback Functions.
+ */
 function audiofield_xspf_slim($player_path, $audio_file) {
   $variables = array(
     'player_path' => $player_path,
     'audio_file' => $audio_file,
   );
-  return theme('audiofield_players_xspf_slim', $variables);
+  return _theme('audiofield_players_xspf_slim', $variables);
 }
 
+/**
+ * Audio Callback Functions.
+ */
 function theme_audiofield_players_xspf_slim($variables) {
   $player_path = $variables['player_path'];
   $audio_file = $variables['audio_file'];
@@ -183,15 +192,21 @@ function theme_audiofield_players_xspf_slim($variables) {
           </object>';
 }
 
+/**
+ * Audio Callback Functions.
+ */
 function audiofield_xspf_button($player_path, $audio_file) {
   $variables = array(
     'player_path' => $player_path,
     'audio_file' => $audio_file,
   );
-  return theme('audiofield_xspf_button', $variables);
+  return _theme('audiofield_players_xspf_button', $variables);
 }
 
-function theme_audiofield_xspf_button($variables) {
+/**
+ * Audio Callback Functions.
+ */
+function theme_audiofield_players_xspf_button($variables) {
   $player_path = $variables['player_path'];
   $audio_file = $variables['audio_file'];
   return '<object type="application/x-shockwave-flash" width="17" height="17"
@@ -201,14 +216,20 @@ function theme_audiofield_xspf_button($variables) {
           </object>';
 }
 
+/**
+ * Audio Callback Functions.
+ */
 function audiofield_premium_beat_single_track($player_path, $audio_file) {
   $variables = array(
     'player_path' => $player_path,
     'audio_file' => $audio_file,
   );
-  return theme('audiofield_players_premium_beat_single_track', $variables);
+  return _theme('audiofield_players_premium_beat_single_track', $variables);
 }
 
+/**
+ * Audio Callback Functions.
+ */
 function theme_audiofield_players_premium_beat_single_track($variables) {
   $player_path = $variables['player_path'];
   $audio_file = $variables['audio_file'];
@@ -219,14 +240,20 @@ function theme_audiofield_players_premium_beat_single_track($variables) {
           </embed></object>';
 }
 
+/**
+ * Audio Callback Functions.
+ */
 function audiofield_premium_beat_thin($player_path, $audio_file) {
   $variables = array(
     'player_path' => $player_path,
     'audio_file' => $audio_file,
   );
-  return theme('audiofield_players_premium_beat_thin', $variables);
+  return _theme('audiofield_players_premium_beat_thin', $variables);
 }
 
+/**
+ * Audio Callback Functions.
+ */
 function theme_audiofield_players_premium_beat_thin($variables) {
   $player_path = $variables['player_path'];
   $audio_file = $variables['audio_file'];
@@ -241,9 +268,12 @@ function audiofield_premium_beat_mini($player_path, $audio_file) {
     'player_path' => $player_path,
     'audio_file' => $audio_file,
   );
-  return theme('audiofield_players_premium_beat_mini', $variables);
+  return _theme('audiofield_players_premium_beat_mini', $variables);
 }
 
+/**
+ * Audio Callback Functions.
+ */
 function theme_audiofield_players_premium_beat_mini($variables) {
   $player_path = $variables['player_path'];
   $audio_file = $variables['audio_file'];
@@ -253,6 +283,9 @@ function theme_audiofield_players_premium_beat_mini($variables) {
         </embed></object>';
 }
 
+/**
+ * Audio Callback Functions.
+ */
 function audiofield_soundmanager2($player_path, $audio_file) {
   static $instanceIndex = 0;
   if ($audio_file == '') {
@@ -260,19 +293,19 @@ function audiofield_soundmanager2($player_path, $audio_file) {
   }
   else {
     $instanceIndex += 1;
-    $player_base_path = variable_get('audiofield_players_dir', 'sites/all/libraries/player') . "/soundmanager2";
+    $player_base_path = \Drupal::config('audiofield.settings')->get('audiofield_players_dir') . "/soundmanager2";
     $ie_js = array(
       '#type' => 'markup',
       '#markup' => '<!--[if IE]><script type="text/javascript" src="' . $player_path . '/demo/360-player/script/excanvas.js"></script><![endif]-->',
     );
     drupal_add_html_head($ie_js, 'audiofield');
 
-    drupal_add_js($player_base_path . '/script/soundmanager2.js');
+    _drupal_add_js($player_base_path . '/script/soundmanager2.js');
 
     //360 viewer
-    drupal_add_js($player_base_path . '/demo/360-player/script/berniecode-animator.js');
-    drupal_add_js($player_base_path . '/demo/360-player/script/360player.js');
-    drupal_add_css($player_base_path . '/demo/360-player/360player.css');
+    _drupal_add_js($player_base_path . '/demo/360-player/script/berniecode-animator.js');
+    _drupal_add_js($player_base_path . '/demo/360-player/script/360player.js');
+    _drupal_add_css($player_base_path . '/demo/360-player/360player.css');
 
     return '
     	<div id="sm2-container-real" class="ui360">
@@ -298,6 +331,10 @@ function audiofield_soundmanager2($player_path, $audio_file) {
 }
 
 if (module_exists('flowplayer')) {
+
+  /**
+   * Audio Callback Functions.
+   */
   function audiofield_flowplayer($player_path, $audio_file) {
     static $seq = 1;
     $variables = array(
@@ -310,32 +347,37 @@ if (module_exists('flowplayer')) {
       'id' => 'audiofield-' . $seq++,
       'attributes' => array('style' => 'height: 24px'),
     );
-    return theme('flowplayer', $variables);
+    return _theme('flowplayer', $variables);
   }
 }
 
 if (module_exists('mediaelement')) {
   function audiofield_mediaelement($player_path, $audio_file) {
     static $seq = 1;
-    drupal_add_library('mediaelement', 'mediaelement');
-    drupal_add_js(drupal_get_path('module', 'mediaelement') . '/mediaelement.js');
-    drupal_add_js(array('mediaelementAll' => TRUE), array('type' => 'setting'));
+    _drupal_add_library('mediaelement', 'mediaelement');
+    _drupal_add_js(drupal_get_path('module', 'mediaelement') . '/mediaelement.js');
+    _drupal_add_js(array('mediaelementAll' => TRUE), array('type' => 'setting'));
 
     $class = 'mediaelement-formatter-identifier-' . time() . '-' . $seq++;
     $variables = array(
       'settings' => array(
-        'controls' => variable_get('mediaelement_audio_default_controls', TRUE),
-        'width' => variable_get('mediaelement_audio_default_width', '300'),
-        'height' => variable_get('mediaelement_audio_default_height', '30'),
-        'download_link' => variable_get('mediaelement_audio_default_download_link', FALSE),
-        'download_text' => variable_get('mediaelement_audio_default_download_text', t('Download')),
+//        'controls' => variable_get('mediaelement_audio_default_controls', TRUE),
+        'controls' => \Drupal::config('audiofield.settings')->get('mediaelement_audio_default_controls'),
+//        'width' => variable_get('mediaelement_audio_default_width', '300'),
+        'width' => \Drupal::config('audiofield.settings')->get('mediaelement_audio_default_width'),
+//        'height' => variable_get('mediaelement_audio_default_height', '30'),
+        'height' => \Drupal::config('audiofield.settings')->get('mediaelement_audio_default_height'),
+//        'download_link' => variable_get('mediaelement_audio_default_download_link', FALSE),
+        'download_link' => \Drupal::config('audiofield.settings')->get('mediaelement_audio_default_download_link'),
+//        'download_text' => variable_get('mediaelement_audio_default_download_text', t('Download')),
+        'download_text' => \Drupal::config('audiofield.settings')->get('mediaelement_audio_default_download_link'),
       ),
       'attributes' => array(
         'src' => $audio_file,
         'class' => $class,
       ),
     );
-    return theme('mediaelement_audio', $variables);
+    return _theme('mediaelement_audio', $variables);
   }
 }
 
@@ -344,13 +386,13 @@ function audiofield_googlereader($player_path, $audio_file) {
     'player_path' => $player_path,
     'audio_file' => $audio_file,
   );
-  return theme('audiofield_googlereader', $variables);
+  return _theme('audiofield_googlereader', $variables);
 }
 
 function theme_audiofield_googlereader($variables) {
   $player_path = $variables['player_path'];
   $audio_file = $variables['audio_file'];
-  return '<embed type="application/x-shockwave-flash" flashvars="audioUrl=' . $audio_file . '" src="http://www.google.com/reader/ui/3523697345-audio-player.swf" width="400" height="27" quality="best"></embed>';
+  return '<embed type="application/x-shockwave-flash" flashvars="audioUrl=' . $audio_file . '" src="http://www.google.com/reader/ui/3523697345-audio-player.swf" width="400" height="70" quality="best"></embed>';
 }
 
 function audiofield_jplayer($player_path, $audio_file) {
@@ -363,9 +405,9 @@ function audiofield_jplayer($player_path, $audio_file) {
     $path_parts = explode('/', $player_path);
     $audio_file_name = array_pop($path_parts);
     $player_base_path = implode('/', $path_parts);
-    drupal_add_js($player_path);
+    _drupal_add_js($player_path);
     $audio_players = audiofield_players();
-    drupal_add_css($audio_players['jplayer']['css']);
+    _drupal_add_css($audio_players['jplayer']['css']);
     return '<div id="jquery_jplayer_' . $instanceIndex . '" class="jp-jplayer"></div>
 
     <div class="jp-audio" id="jp_container_' . $instanceIndex . '">
diff --git a/audiofield_formatter.inc b/audiofield_formatter.inc
index 3dc7e97..402891f 100644
--- a/audiofield_formatter.inc
+++ b/audiofield_formatter.inc
@@ -1,48 +1,58 @@
 <?php
-// $Id: audiofield_formatter.inc,v 1.21.2.3 2011/02/20 10:13:26 tamerzg Exp $:
-/**@file
+/**
+ * @file
  * Theme function for 'embedded' audio.
  */
 function theme_audiofield_formatter_audiofield_embedded($variables) {
   global $user;
-  $file = $variables['file'];
+  $item = $variables['item'];
+  $file = !empty($item->entity) ? $item->entity : $item;
+  $options['attributes']['type'] = $file->getMimeType() . '; length=' . $file->getSize();
 
-  if (!$file) {
-    return '';
+  // Use the description as the link text if available.
+  if (empty($variables['description'])) {
+    $link_text = $file->getFilename();
+  }
+  else {
+    $link_text = $variables['description'];
+    $options['attributes']['title'] = check_plain($file->getFilename());
   }
 
-  $audiofile = file_create_url($file->uri);
-  $info = pathinfo($audiofile);
-  $op = $info['extension'];
-  $output = audiofield_get_player($audiofile, $op);
+  $file_icon = array(
+    '#theme' => 'file_icon',
+    '#file' => $file,
+  );
+  $uri = file_create_url($file->getFileUri());
 
-  //If user is file owner check for download permission and display download link
-  if ($user->uid == $file->uid && user_access('download own audio files')) {
-    $output .= '<div class="audio-download"><b>Download:</b>' . theme('file_link', array('file' => (object) $file)) . '</div>';
+  $info = pathinfo($uri);
+  $op = $info['extension'];
+  $output = audiofield_get_player($uri, $op);
+  if (user_access('download own audio files')) {
+    //If user is file owner check for download permission and display download link.
+    $output .= '<span class="file">' .
+      '<div class="audio-download"><b>Download:</b>' .
+      drupal_render($file_icon) . ' ' .
+      l($link_text, file_create_url($file->getFileUri()), $options)  . '</div> </span>';
   }
   elseif (user_access('download all audio files')) {
-    //If user has permission to download all audio files, then display download link
-    $output .= '<div class="audio-download"><b>Download:</b>' . theme('file_link', array('file' => (object) $file)) . '</div>';
+    //If user has permission to download all audio files, then display download link.
+    $output .= '<span class="file">' . '<div class="audio-download"><b>Download:</b>' .
+      drupal_render($file_icon) . ' ' .
+      l($link_text, file_create_url($file->getFileUri()), $options)  . '</div> </span>';
   }
 
   return $output;
 }
 
-/*
+/**
  * Theme function for 'embedded' audio.
  */
 function theme_audiofield_formatter_audiofield_nodownload($variables) {
-  global $user;
-  $file = $variables['file'];
-
-  if (!$file) {
-    return '';
-  }
-
-  $audiofile = file_create_url($file->uri);
-  $info = pathinfo($audiofile);
+  $item = $variables['item'];
+  $uri = file_create_url($item->entity->getFileUri());
+  $info = pathinfo($uri);
   $op = $info['extension'];
-  $output = audiofield_get_player($audiofile, $op);
+  $output = audiofield_get_player($uri, $op);
 
   return $output;
 }
diff --git a/config/audiofield.settings.yml b/config/audiofield.settings.yml
index f421d29..814b923 100644
--- a/config/audiofield.settings.yml
+++ b/config/audiofield.settings.yml
@@ -1 +1,2 @@
 audiofield_audioplayer: 'google_reader'
+audiofield_players_dir: 'sites/all/libraries/player'
diff --git a/lib/Drupal/audiofield/Form/AudiofieldSettingsForm.php b/lib/Drupal/audiofield/Form/AudiofieldSettingsForm.php
deleted file mode 100644
index 312adf0..0000000
--- a/lib/Drupal/audiofield/Form/AudiofieldSettingsForm.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\audiofield\Form\PantsSettingsForm.
- */
-
-namespace Drupal\audiofield\Form;
-
-use Drupal\Core\Form\ConfigFormBase;
-
-/**
- * Configure AudioField settings for this site.
- */
-class AudiofieldSettingsForm extends ConfigFormBase {
-
-  /**
-   * {@inheritdoc}
-   */
-  public function getFormID() {
-    return 'audiofield_settings';
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function buildForm(array $form, array &$form_state) {
-    $config = $this->configFactory->get('audiofield.settings');
-    $audio_players = audiofield_players();
-    $players = array();
-    $download_players = '';
-    foreach ($audio_players as $id => $player) {
-      if (file_exists($player['path']) || (isset($player['external']) && $player['external'])) {
-        foreach ($player['filetypes'] as $filetype) {
-          $players[$filetype][$id] = $player['name'] . '<br/>'; /* . call_user_func($player['callback'], $base_path . $player['path'], "");*/
-        }
-      }
-      else {
-        if (isset($player['download_link'])) {
-          $download_players .= '<li>Download ' . l($player['name'], $player['download_link']) . '</li>';
-        }
-      }
-    }
-
-    //MP3 Players list
-    if (!empty($players['mp3'])) {
-      $form['audiofield_audioplayer'] = array(
-        '#type' => 'radios',
-        '#title' => t('MP3 Audio Players'),
-        '#options' => $players['mp3'],
-        '#default_value' => $config->get('audiofield_audioplayer'),
-      );
-      unset($players['mp3']);
-    }
-
-    //Other players list (wav, wma,...)
-    foreach ($players as $filetype => $type_player) {
-      $form['audiofield_audioplayer_' . $filetype] = array(
-        '#type' => 'radios',
-        '#title' => check_plain($filetype . ' ' . t('Audio Players')),
-        '#options' => $type_player,
-        '#default_value' => $config->get('audiofield_audioplayer_' . $filetype),
-      );
-    }
-
-    $form['audiofield_players_dir'] = array(
-      '#type' => 'textfield',
-      '#title' => t('Audio Players Directory'),
-      '#description' => t('Download and extract audio players in this directory'),
-      '#default_value' => $config->get('audiofield_players_dir'),
-    );
-
-    if (!empty($download_players)) {
-      $form['audiofield_downloadaudioplayer'] = array(
-        '#type' => 'item',
-        '#title' => t('Download and install audio players'),
-        '#markup' => '<ul class="audiofield-download-players">' . $download_players . '</ul>',
-      );
-    }
-
-    return parent::buildForm($form, $form_state);
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function submitForm(array &$form, array &$form_state) {
-    $config = $this->configFactory->get('audiofield.settings');
-    foreach($form_state['values'] as $field_name => $value) {
-      //@todo validate that this is audiofield setting
-      $config->set($field_name, $value);
-    }
-
-    $config->save();
-    parent::submitForm($form, $form_state);
-  }
-}
diff --git a/src/Form/AudiofieldSettingsForm.php b/src/Form/AudiofieldSettingsForm.php
new file mode 100644
index 0000000..9a5238f
--- /dev/null
+++ b/src/Form/AudiofieldSettingsForm.php
@@ -0,0 +1,97 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\audiofield\Form\PantsSettingsForm.
+ */
+
+namespace Drupal\audiofield\Form;
+
+use Drupal\Core\Form\ConfigFormBase;
+
+/**
+ * Configure AudioField settings for this site.
+ */
+class AudiofieldSettingsForm extends ConfigFormBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormID() {
+    return 'audiofield_settings';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, array &$form_state) {
+    $config = $this->config('audiofield.settings');
+    $audio_players = audiofield_players();
+    $players = array();
+    $download_players = '';
+    foreach ($audio_players as $id => $player) {
+      if (file_exists($player['path']) || (isset($player['external']) && $player['external'])) {
+        foreach ($player['filetypes'] as $filetype) {
+          $players[$filetype][$id] = $player['name'] . '<br/>'; /* . call_user_func($player['callback'], $base_path . $player['path'], "");*/
+        }
+      }
+      else {
+        if (isset($player['download_link'])) {
+          $download_players .= '<li>Download ' . l($player['name'], $player['download_link']) . '</li>';
+        }
+      }
+    }
+
+    //MP3 Players list
+    if (!empty($players['mp3'])) {
+      $form['audiofield_audioplayer'] = array(
+        '#type' => 'radios',
+        '#title' => t('MP3 Audio Players'),
+        '#options' => $players['mp3'],
+        '#default_value' => $config->get('audiofield_audioplayer'),
+      );
+      unset($players['mp3']);
+    }
+
+    //Other players list (wav, wma,...)
+    foreach ($players as $filetype => $type_player) {
+      $form['audiofield_audioplayer_' . $filetype] = array(
+        '#type' => 'radios',
+        '#title' => check_plain($filetype . ' ' . t('Audio Players')),
+        '#options' => $type_player,
+        '#default_value' => $config->get('audiofield_audioplayer_' . $filetype),
+      );
+    }
+
+    $form['audiofield_players_dir'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Audio Players Directory'),
+      '#description' => t('Download and extract audio players in this directory'),
+      '#default_value' => $config->get('audiofield_players_dir'),
+    );
+
+    if (!empty($download_players)) {
+      $form['audiofield_downloadaudioplayer'] = array(
+        '#type' => 'item',
+        '#title' => t('Download and install audio players'),
+        '#markup' => '<ul class="audiofield-download-players">' . $download_players . '</ul>',
+      );
+    }
+
+    return parent::buildForm($form, $form_state);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, array &$form_state) {
+    $config = $this->config('audiofield.settings');
+    foreach($form_state['values'] as $field_name => $value) {
+      //@todo validate that this is audiofield setting
+      $config->set($field_name, $value);
+    }
+
+    $config->save();
+    parent::submitForm($form, $form_state);
+  }
+}
diff --git a/src/Plugin/Field/FieldFormatter/AudioFormatter.php b/src/Plugin/Field/FieldFormatter/AudioFormatter.php
new file mode 100644
index 0000000..18d0ad1
--- /dev/null
+++ b/src/Plugin/Field/FieldFormatter/AudioFormatter.php
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\link\Plugin\field\formatter\LinkFormatter.
+ */
+
+namespace Drupal\audiofield\Plugin\Field\FieldFormatter;
+
+use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Field\FormatterBase;
+
+/**
+ * Plugin implementation of the 'foo_formatter' formatter
+ *
+ * @FieldFormatter(
+ *   id = "audio_formatter",
+ *   label = @Translation("Audio player with download"),
+ *   field_types = {
+ *     "file"
+ *   },
+ * )
+ */
+class AudioFormatter extends FormatterBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function viewElements(FieldItemListInterface $items) {
+    $elements = array();
+
+    foreach ($items as $delta => $item) {
+
+      if ($this->getPluginId() == 'audio_formatter') {
+
+        if ($item->entity) {
+          $audio_uri = $item->entity->getFileUri();
+          $uri = array(
+            'path' => file_create_url($audio_uri),
+            'options' => array(),
+          );
+          $item_attributes = $item->_attributes;
+          $elements[$delta] = array(
+            '#theme' => 'audiofield_formatter_audiofield_embedded',
+            '#item' => $item,
+            '#item_attributes' => $item_attributes,
+            '#path' => isset($uri) ? $uri : '',
+          );
+        }
+      }
+    }
+
+    return $elements;
+  }
+}
diff --git a/src/Plugin/Field/FieldFormatter/AudioFormatterNoDownload.php b/src/Plugin/Field/FieldFormatter/AudioFormatterNoDownload.php
new file mode 100644
index 0000000..bd37153
--- /dev/null
+++ b/src/Plugin/Field/FieldFormatter/AudioFormatterNoDownload.php
@@ -0,0 +1,48 @@
+<?php
+
+namespace Drupal\audiofield\Plugin\Field\FieldFormatter;
+
+use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Field\FormatterBase;
+/**
+ * Plugin implementation of the 'foo_formatter' formatter
+ *
+ * @FieldFormatter(
+ *   id = "audio_formatter_no_download",
+ *   label = @Translation("Audio player with no download"),
+ *   field_types = {
+ *     "file"
+ *   },
+ * )
+ */
+class AudioFormatterNoDownload extends FormatterBase {
+  /**
+   * {@inheritdoc}
+   */
+  public function viewElements(FieldItemListInterface $items) {
+    $elements = array();
+
+    foreach ($items as $delta => $item) {
+      if ($this->getPluginId() == 'audio_formatter_no_download') {
+
+        if ($item->entity) {
+          $audio_uri = $item->entity->getFileUri();
+          $uri = array(
+            'path' => file_create_url($audio_uri),
+            'options' => array(),
+          );
+          $item_attributes = $item->_attributes;
+          $elements[$delta] = array(
+            '#theme' => 'audiofield_formatter_audiofield_nodownload',
+            '#item' => $item,
+            '#item_attributes' => $item_attributes,
+            '#path' => isset($uri) ? $uri : '',
+          );
+        }
+      }
+    }
+
+    return $elements;
+  }
+}
+
diff --git a/src/Plugin/Field/FieldWidget/AudioDefaultWidget.php b/src/Plugin/Field/FieldWidget/AudioDefaultWidget.php
new file mode 100644
index 0000000..6c9ac2d
--- /dev/null
+++ b/src/Plugin/Field/FieldWidget/AudioDefaultWidget.php
@@ -0,0 +1,92 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\file\Plugin\Field\FieldWidget\FileWidget.
+ */
+
+namespace Drupal\audiofield\Plugin\Field\FieldWidget;
+
+use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\file\Plugin\Field\FieldWidget\FileWidget;
+
+/**
+ * Plugin implementation of the 'email_default' widget.
+ *
+ * @FieldWidget(
+ *   id = "audiofield_widget",
+ *   label = @Translation("Audio Upload"),
+ *   field_types = {
+ *     "file"
+ *   },
+ *   settings = {
+ *     "progress_indicator" = "throbber",
+ *   }
+ * )
+ */
+class AudioDefaultWidget extends FileWidget {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, array &$form_state) {
+    $element = parent::formElement($items, $delta, $element, $form, $form_state);
+    $supported_extensions = array('mp3', 'wav', 'ogg', 'midi');
+    $extensions = isset($element['#upload_validators']['file_validate_extensions'][0]) ? $element['#upload_validators']['file_validate_extensions'][0] : implode(' ', $supported_extensions);
+    $extensions = array_intersect(explode(' ', $extensions), $supported_extensions);
+    $element['#upload_validators']['file_validate_extensions'][0] = implode(' ', $extensions);
+    $element['#process'][] = array(get_class($this), 'process');
+
+    return $element;
+  }
+
+  /**
+   * This method is assigned as a #process callback in formElement() method.
+   */
+  public static function process($element, &$form_state, $form) {
+    $element['#theme'] = 'file_widget';
+    $item['fids'] = $element['fids']['#value'];
+
+    if (!empty($element['#files'])) {
+      $file = reset($element['#files']);
+      $audiofile = file_create_url($file->getFileUri());
+      $info = pathinfo($audiofile);
+      $op = $info['extension'];
+      $element['filename'] = array(
+        '#type' => 'markup',
+        '#markup' => audiofield_get_player($audiofile, $op),
+        '#weight' => -10,
+      );
+    }
+
+    return $element;
+  }
+
+  /**
+   * Form API callback. Retrieves the value for the file_generic field element.
+   *
+   * This method is assigned as a #value_callback in formElement() method.
+   */
+  public static function value($element, $input = FALSE, $form_state) {
+    if ($input) {
+      // Checkboxes lose their value when empty.
+      // If the display field is present make sure its unchecked value is saved.
+      if (empty($input['display'])) {
+        $input['display'] = $element['#display_field'] ? 0 : 1;
+      }
+    }
+
+    // We depend on the managed file element to handle uploads.
+    $return = file_managed_file_value($element, $input, $form_state);
+
+    // Ensure that all the required properties are returned even if empty.
+    $return += array(
+      'fids' => array(),
+      'display' => 1,
+      'description' => '',
+    );
+
+    return $return;
+  }
+
+}
