diff --git a/bootstrap_toggle.info.yml b/bootstrap_toggle.info.yml
index f2df321..33f58ea 100644
--- a/bootstrap_toggle.info.yml
+++ b/bootstrap_toggle.info.yml
@@ -2,5 +2,3 @@ name: Bootstrap Toggle
 description: Provides Bootstrap Toggle Button as a widget for boolean field.
 type: module
 core: 8.x
-dependencies:
-  - libraries
diff --git a/bootstrap_toggle.install b/bootstrap_toggle.install
deleted file mode 100644
index ee2b298..0000000
--- a/bootstrap_toggle.install
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * @file
- * Install file.
- */
-
-use Drupal\Core\Url;
-
-/**
- * Implements hook_requirements().
- */
-function bootstrap_toggle_requirements($phase) {
-  $requirements = array();
-  if ($phase == 'runtime') {
-    // Library to check.
-    $indexes = array(
-      'bootstrap_toggle' => array(
-        'name' => 'bootstrap_toggle',
-        'folder' => 'bootstrap_toggle',
-      ),
-    );
-
-    foreach ($indexes as $key => $index) {
-      $library = libraries_detect($index['name']);
-
-      if (empty($library['installed'])) {
-        // Library is not installed.
-        $url = Url::fromUri($library['download url']);
-        $library_download_link = \Drupal::l($library['name'], $url);
-        $requirements[$key] = array(
-          'title' => t('Bootstrap Toggle Library'),
-          'value' => t('Missing bootstrap_toggle library !'),
-          'severity' => REQUIREMENT_ERROR,
-          'description' => t('In oder to use bootstrap_toggle buttons you need to download the %library library, extract the archive, rename and place the %folder directory in the %path directory under the docroot of your site.', array(
-            '%library' => $library_download_link,
-            '%folder' => $index['folder'],
-            '%path' => 'libraries',
-          )
-          ),
-        );
-      }
-    }
-  }
-
-  return $requirements;
-}
diff --git a/bootstrap_toggle.libraries.yml b/bootstrap_toggle.libraries.yml
index 1b36644..2a975d8 100644
--- a/bootstrap_toggle.libraries.yml
+++ b/bootstrap_toggle.libraries.yml
@@ -1,8 +1,14 @@
-bootstrap_toggle_css:
-  css:
-    theme:
-      /libraries/bootstrap_toggle/css/bootstrap-toggle.min.css: {}
-
-bootstrap_toggle_js:
+bootstrap_toggle:
+  remote: http://www.bootstraptoggle.com/
+  version: 2.2.0
+  license:
+    name: MIT
+    url: http://www.bootstraptoggle.com/
   js:
-    /libraries/bootstrap_toggle/js/bootstrap-toggle.min.js: {}
+    //gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js: { type: external, minified: true }
+  css:
+    base:
+      //gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css: { type: external, minified: true }
+      //maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css: { type: external, minified: true }
+  dependencies:
+        - core/jquery
\ No newline at end of file
diff --git a/bootstrap_toggle.module b/bootstrap_toggle.module
deleted file mode 100644
index 685ce2d..0000000
--- a/bootstrap_toggle.module
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-/**
- * @file
- * This module provides a toggle widget for boolean field type.
- */
-
-/**
- * Implements hook_libraries_info().
- */
-function bootstrap_toggle_libraries_info() {
-  $libraries['bootstrap_toggle'] = array(
-    'name' => 'bootstrap_toggle',
-    'vendor url' => 'http://www.bootstraptoggle.com/',
-    'download url' => 'https://github.com/minhur/bootstrap-toggle/archive/master.zip',
-    'files' => array(
-      'js' => array('js/bootstrap-toggle.min.js'),
-      'css' => array('css/bootstrap-toggle.min.css'),
-    ),
-    'path' => 'libraries',
-    'installed' => bootstrap_toggle_library_installed(),
-  );
-
-  return $libraries;
-}
-
-/**
- * Checks if library exists or not.
- *
- * @return bool
- *   True if library is installed and false if not.
- */
-function bootstrap_toggle_library_installed() {
-  if (file_exists('libraries/bootstrap_toggle/css/bootstrap-toggle.min.css') && file_exists('libraries/bootstrap_toggle/js/bootstrap-toggle.min.js')) {
-    return TRUE;
-  }
-
-  return FALSE;
-}
diff --git a/src/Plugin/Field/FieldWidget/BootstrapToggle.php b/src/Plugin/Field/FieldWidget/BootstrapToggle.php
index eabf16e..f40f37e 100644
--- a/src/Plugin/Field/FieldWidget/BootstrapToggle.php
+++ b/src/Plugin/Field/FieldWidget/BootstrapToggle.php
@@ -26,13 +26,13 @@ class BootstrapToggle extends WidgetBase {
   public static function defaultSettings() {
     return array(
       'display_label' => 1,
-      'bootstraptoggle_data_on' => 'On',
-      'bootstraptoggle_data_off' => 'Off',
-      'bootstraptoggle_box_size' => 1,
-      'bootstraptoggle_on_style' => 0,
-      'bootstraptoggle_off_style' => 5,
-      'bootstraptoggle_box_height' => '',
-      'bootstraptoggle_box_width' => '',
+      'data-on' => 'On',
+      'data-off' => 'Off',
+      'data-size' => 'normal',
+      'data-onstyle' => 'primary',
+      'data-offstyle' => 'default',
+      'data-height' => '',
+      'data-width' => '',
     ) + parent::defaultSettings();
   }
 
@@ -47,68 +47,68 @@ class BootstrapToggle extends WidgetBase {
       '#options' => array(0 => t('Show field label'), 1 => t('Do not show any label')),
       '#weight' => -1,
     );
-    $element['bootstraptoggle_data_on'] = array(
+    $element['data-on'] = array(
       '#type' => 'textfield',
       '#title' => t('Use custom label for "On label" as label'),
-      '#default_value' => $this->getSetting('bootstraptoggle_data_on'),
+      '#default_value' => $this->getSetting('data-on'),
       '#weight' => -1,
     );
-    $element['bootstraptoggle_data_off'] = array(
+    $element['data-off'] = array(
       '#type' => 'textfield',
       '#title' => t('Use custom label for "Off label" as label'),
-      '#default_value' => $this->getSetting('bootstraptoggle_data_off'),
+      '#default_value' => $this->getSetting('data-off'),
       '#weight' => -1,
     );
-    $element['bootstraptoggle_box_size'] = array(
+    $element['data-size'] = array(
       '#type' => 'radios',
       '#title' => t('Set size of toggle button'),
-      '#default_value' => $this->getSetting('bootstraptoggle_box_size'),
+      '#default_value' => $this->getSetting('data-size'),
       '#options' => array(
-        0 => t('Large'),
-        1 => t('Normal'),
-        2 => t('Small'),
-        3 => t('Mini'),
+        'large' => t('Large'),
+        'normal' => t('Normal'),
+        'small' => t('Small'),
+        'mini' => t('Mini'),
       ),
       '#weight' => -1,
     );
-    $element['bootstraptoggle_on_style'] = array(
+    $element['data-onstyle'] = array(
       '#type' => 'radios',
       '#title' => t('Set on style of toggle button'),
-      '#default_value' => $this->getSetting('bootstraptoggle_on_style'),
+      '#default_value' => $this->getSetting('data-onstyle'),
       '#options' => array(
-        0 => t('Primary'),
-        1 => t('Success'),
-        2 => t('Info'),
-        3 => t('Warning'),
-        4 => t('Danger'),
-        5 => t('Default'),
+        'primary' => t('Primary'),
+        'success' => t('Success'),
+        'info' => t('Info'),
+        'warning' => t('Warning'),
+        'danger' => t('Danger'),
+        'default' => t('Default'),
       ),
       '#weight' => -1,
     );
-    $element['bootstraptoggle_off_style'] = array(
+    $element['data-offstyle'] = array(
       '#type' => 'radios',
       '#title' => t('Set off style of toggle button'),
-      '#default_value' => $this->getSetting('bootstraptoggle_off_style'),
+      '#default_value' => $this->getSetting('data-offstyle'),
       '#options' => array(
-        0 => t('Primary'),
-        1 => t('Success'),
-        2 => t('Info'),
-        3 => t('Warning'),
-        4 => t('Danger'),
-        5 => t('Default'),
+        'primary' => t('Primary'),
+        'success' => t('Success'),
+        'info' => t('Info'),
+        'warning' => t('Warning'),
+        'danger' => t('Danger'),
+        'default' => t('Default'),
       ),
       '#weight' => -1,
     );
-    $element['bootstraptoggle_box_height'] = array(
+    $element['data-height'] = array(
       '#type' => 'textfield',
       '#title' => t('Set height of toggle button'),
-      '#default_value' => $this->getSetting('bootstraptoggle_box_height'),
+      '#default_value' => $this->getSetting('data-height'),
       '#weight' => -1,
     );
-    $element['bootstraptoggle_box_width'] = array(
+    $element['data-width'] = array(
       '#type' => 'textfield',
       '#title' => t('Set width of toggle button'),
-      '#default_value' => $this->getSetting('bootstraptoggle_box_width'),
+      '#default_value' => $this->getSetting('data-width'),
       '#weight' => -1,
     );
 
@@ -124,104 +124,25 @@ class BootstrapToggle extends WidgetBase {
     $display_label = $this->getSetting('display_label');
     $summary[] = t('Label: @display_label', array('@display_label' => ($display_label ? 'None' : t('Field label'))));
 
-    $data_on = $this->getSetting('bootstraptoggle_data_on');
+    $data_on = $this->getSetting('data-on');
     $summary[] = t('On label: @data_on', array('@data_on' => ($data_on ? $data_on : 'Default')));
 
-    $data_off = $this->getSetting('bootstraptoggle_data_off');
+    $data_off = $this->getSetting('data-off');
     $summary[] = t('Off label: @data_off', array('@data_off' => ($data_off ? $data_off : 'Default')));
 
-    $box_size = $this->getSetting('bootstraptoggle_box_size');
-    switch ($box_size) {
-      case 0:
-        $box_size_name = 'Large';
-        break;
-
-      case 1:
-        $box_size_name = 'Normal';
-        break;
-
-      case 2:
-        $box_size_name = 'Small';
-        break;
-
-      case 3:
-        $box_size_name = 'Mini';
-        break;
-
-      default:
-        $box_size_name = 'Default';
-        break;
-    }
+    $box_size_name = $this->getSetting('data-size');
     $summary[] = t('Box size: @box_size', array('@box_size' => $box_size_name));
 
-    $box_style_on = $this->getSetting('bootstraptoggle_on_style');
-    switch ($box_style_on) {
-      case 0:
-        $box_style_on_name = 'Primary';
-        break;
-
-      case 1:
-        $box_style_on_name = 'Success';
-        break;
-
-      case 2:
-        $box_style_on_name = 'Info';
-        break;
-
-      case 3:
-        $box_style_on_name = 'Warning';
-        break;
-
-      case 4:
-        $box_style_on_name = 'Danger';
-        break;
-
-      case 5:
-        $box_style_on_name = 'Default';
-        break;
-
-      default:
-        $box_style_on_name = 'None';
-        break;
-    }
+    $box_style_on_name = $this->getSetting('data-onstyle');
     $summary[] = t('On state style: @box_style', array('@box_style' => $box_style_on_name));
 
-    $box_style_off = $this->getSetting('bootstraptoggle_off_style');
-    switch ($box_style_off) {
-      case 0:
-        $box_style_off_name = 'Primary';
-        break;
-
-      case 1:
-        $box_style_off_name = 'Success';
-        break;
-
-      case 2:
-        $box_style_off_name = 'Info';
-        break;
-
-      case 3:
-        $box_style_off_name = 'Warning';
-        break;
-
-      case 4:
-        $box_style_off_name = 'Danger';
-        break;
-
-      case 5:
-        $box_style_off_name = 'Default';
-        break;
-
-      default:
-        $box_style_off_name = 'None';
-        break;
-    }
+    $box_style_off_name = $this->getSetting('data-offstyle');
     $summary[] = t('Off state style: @box_style', array('@box_style' => $box_style_off_name));
 
-    $box_height = $this->getSetting('bootstraptoggle_box_height');
+    $box_height = $this->getSetting('data-height');
     $summary[] = t('Box height: @box_height', array('@box_height' => ($box_height ? $box_height : 'Default')));
 
-    $box_width = $this->getSetting('bootstraptoggle_box_width');
+    $box_width = $this->getSetting('data-width');
     $summary[] = t('Box width: @box_width', array('@box_width' => ($box_width ? $box_width : 'Default')));
 
     return $summary;
@@ -240,123 +161,15 @@ class BootstrapToggle extends WidgetBase {
     );
 
     // Override the title from the incoming $element.
-    if ($this->getSetting('display_label') == 0) {
-      $element['#title'] = $this->fieldDefinition->getLabel();
-    }
-    elseif ($this->getSetting('display_label') == 1) {
-      unset($element['#title']);
-    }
-
-    // Set data-on and data-off attributes in a button.
-    if ($this->getSetting('bootstraptoggle_data_on')) {
-      $element['#attributes']['data-on'] = $this->getSetting('bootstraptoggle_data_on');
-    }
-    if ($this->getSetting('bootstraptoggle_data_off')) {
-      $element['#attributes']['data-off'] = $this->getSetting('bootstraptoggle_data_off');
+    if ($this->getSetting('display_label')) {
+      $element['#title_display'] = 'invisible';
     }
 
-    // Set data-size attribute of button.
-    $box_size = $this->getSetting('bootstraptoggle_box_size');
-    switch ($box_size) {
-      case 0:
-        $box_size_name = 'large';
-        break;
-
-      case 1:
-        $box_size_name = 'normal';
-        break;
-
-      case 2:
-        $box_size_name = 'small';
-        break;
-
-      case 3:
-        $box_size_name = 'mini';
-        break;
-
-      default:
-        $box_size_name = '';
-        break;
-    }
-    $element['#attributes']['data-size'] = $box_size_name;
-
-    // Box off style.
-    $box_style_off = $this->getSetting('bootstraptoggle_off_style');
-    switch ($box_style_off) {
-      case 0:
-        $box_style_off_name = 'primary';
-        break;
-
-      case 1:
-        $box_style_off_name = 'success';
-        break;
-
-      case 2:
-        $box_style_off_name = 'info';
-        break;
-
-      case 3:
-        $box_style_off_name = 'warning';
-        break;
-
-      case 4:
-        $box_style_off_name = 'danger';
-        break;
-
-      case 5:
-        $box_style_off_name = 'default';
-        break;
-
-      default:
-        $box_style_off_name = '';
-        break;
-    }
-    $element['#attributes']['data-offstyle'] = $box_style_off_name;
-
-    // Box on style.
-    $box_style_on = $this->getSetting('bootstraptoggle_on_style');
-    switch ($box_style_on) {
-      case 0:
-        $box_style_on_name = 'primary';
-        break;
-
-      case 1:
-        $box_style_on_name = 'success';
-        break;
-
-      case 2:
-        $box_style_on_name = 'info';
-        break;
-
-      case 3:
-        $box_style_on_name = 'warning';
-        break;
-
-      case 4:
-        $box_style_on_name = 'danger';
-        break;
-
-      case 5:
-        $box_style_on_name = 'default';
-        break;
-
-      default:
-        $box_style_on_name = '';
-        break;
-    }
-    $element['#attributes']['data-onstyle'] = $box_style_on_name;
-
-    // Height of Box.
-    if ($box_height = $this->getSetting('bootstraptoggle_box_height')) {
-      $element['#attributes']['data-height'] = is_numeric($box_height) ? $box_height : '';
-    }
-    if ($box_width = $this->getSetting('bootstraptoggle_box_width')) {
-      $element['#attributes']['data-width'] = is_numeric($box_width) ? $box_width : '';
-    }
+    // Set data attributes in the button.
+    $element['#attributes'] += array_filter($this->getSettings());
 
     // Add libraries.
-    $form['#attached']['library'][] = 'bootstrap_toggle/bootstrap_toggle_css';
-    $form['#attached']['library'][] = 'bootstrap_toggle/bootstrap_toggle_js';
+    $form['#attached']['library'][] = 'bootstrap_toggle/bootstrap_toggle';
 
     return array('value' => $element);
   }
