diff --git a/README.txt b/README.txt
index 7999028..e876fd9 100755
--- a/README.txt
+++ b/README.txt
@@ -14,24 +14,30 @@ CONTENTS
 
 1. INTRODUCTION
 ---------------
-* Show a message in a Responsive Popup for your first time users. The module doesn't require any JavaScript library but
+* Show a message in a Responsive Popup for your first time users.
+  The module doesn't require any JavaScript library but
   uses pure JavaScript to show a nice Popup.
-* The module stores the browser cookie information about the user so the popup is displayed only once, first time the
-  user visits your website.
+* The module stores the browser cookie information about the user
+  so the popup is displayed only once,first time the user visits your website.
 
 2. INSTALLATION
 ---------------
 * Install as you would normally install a contributed Drupal module. See:
-  https://www.drupal.org/docs/8/extending-drupal-8/installing-contributed-modules-find-import-enable-configure-drupal-8
+  https://www.drupal.org/docs/8/extending-drupal-8
+  /installing-contributed-modules-find-import-enable-configure-drupal-8
   for further information.
 
 3. Usage:
 ---------
-  * Once the module is installed, go to '/admin/config/popup_dialog/popupsettings'.
-  * When enable checkbox is checked, users will be getting the Popup based on cookie.
+  * Once the module is installed, go to
+  '/admin/config/popup_dialog/popupsettings'.
+  * When enable checkbox is checked,
+    users will be getting the Popup based on cookie.
   * Custom Content, Blocks, Views options is there in Category Settings.
-  * You can select existing blocks or views or can create custom content to show in the popup.
-  * Delay amount is the time lag after which the popup will be shown to the user.
+  * You can select existing blocks or views or can create custom content
+    to show in the popup.
+  * Delay amount is the time lag after which the popup will be shown
+    to the user.
   * Top Offset is the vertical spacing of the popup from top.
 
 4. CONFIGURATION
diff --git a/css/popup_dialog.css b/css/popup_dialog.css
index eff6353..1817d9a 100644
--- a/css/popup_dialog.css
+++ b/css/popup_dialog.css
@@ -18,9 +18,9 @@
 }
 
 /*@media all and (min-width: 768px) {*/
-  /*#popup-dialog-window {*/
-    /*width: 30%;*/
-  /*}*/
+/*#popup-dialog-window {*/
+/*width: 30%;*/
+/*}*/
 /*}*/
 
 #popup-header {
diff --git a/popup_dialog.module b/popup_dialog.module
index 197c1cb..4cbe4ab 100644
--- a/popup_dialog.module
+++ b/popup_dialog.module
@@ -5,6 +5,7 @@
  * Contains popup_dialog.module..
  */
 
+use Drupal\block\BlockViewBuilder;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\block\Entity\Block;
 
@@ -16,18 +17,19 @@ function popup_dialog_help($route_name, RouteMatchInterface $route_match) {
     // Main module help for the popup_dialog module.
     case 'help.page.popup_dialog':
       $text = file_get_contents(dirname(__FILE__) . "/README.txt");
-      if (! \Drupal::moduleHandler()->moduleExists('markdown')) {
+      if (!\Drupal::moduleHandler()->moduleExists('markdown')) {
         return '<pre>' . $text . '</pre>';
       }
       else {
         // Use the Markdown filter to render the README.
         $filter_manager = \Drupal::service('plugin.manager.filter');
         $settings = \Drupal::configFactory()->get('markdown.settings')->getRawData();
-        $config = array('settings' => $settings);
+        $config = ['settings' => $settings];
         $filter = $filter_manager->createInstance('markdown', $config);
         return $filter->process($text, 'en');
       }
       break;
+
     default:
   }
 }
@@ -44,14 +46,14 @@ function popup_dialog_page_attachments(array &$attachments) {
   $mycookie = \Drupal::request()->cookies->get('FirstUser');
   if ($mycookie != 1 && $enabled == 1) {
     $category_settings = $config->get('category_settings');
-    if($category_settings == 1) {
+    if ($category_settings == 1) {
       $title = $config->get('popup_box_title');
       $body_raw = $config->get('popup_box_body');
       $body = $body_raw['value'];
       $attachments['#attached']['drupalSettings']['title'] = $title;
       $attachments['#attached']['drupalSettings']['body'] = $body;
     }
-    elseif($category_settings == 2) {
+    elseif ($category_settings == 2) {
       $get_plugin_id = $config->get('list_of_blocks');
       $split_get_plugin_id = explode("|", $get_plugin_id);
       $plugin_id = $split_get_plugin_id[0];
@@ -60,31 +62,31 @@ function popup_dialog_page_attachments(array &$attachments) {
       $entityQuery->condition('plugin', $plugin_id);
       $block_id = $entityQuery->execute();
       $theme = \Drupal::service('theme.manager')->getActiveTheme()->getName();
-      if(empty($block_id)) {
+      if (empty($block_id)) {
         $remove_space_title = str_replace(' ', '', $title);
         $title = preg_replace('/[^A-Za-z0-9]/', '', $remove_space_title);
         $block_id = $title . "_" . rand();
-        $values = array(
+        $values = [
           'id' => $block_id,
           'plugin' => $plugin_id,
           'region' => 'content',
           'theme' => $theme,
-          'settings' => array(
+          'settings' => [
             'label_display' => 0,
-          ),
-        );
+          ],
+        ];
         $block = Block::create($values);
         $block->save();
       }
-      if(is_array($block_id)) {
+      if (is_array($block_id)) {
         $block_id = array_keys($block_id)[0];
       }
-      $block_details = \Drupal\block\BlockViewBuilder::lazyBuilder($block_id, 'full');
+      $block_details = BlockViewBuilder::lazyBuilder($block_id, 'full');
       $render = \Drupal::service('renderer')->renderPlain($block_details);
       $attachments['#attached']['drupalSettings']['title'] = $render->__toString();
       $attachments['#attached']['drupalSettings']['body'] = '';
     }
-    elseif($category_settings == 3) {
+    elseif ($category_settings == 3) {
       $get_view = $config->get('list_of_views');
       $arg = $config->get('arguments');
       $exp_view = explode(":", $get_view);
diff --git a/popup_dialog.routing.yml b/popup_dialog.routing.yml
index 5459e8c..c60f2c0 100644
--- a/popup_dialog.routing.yml
+++ b/popup_dialog.routing.yml
@@ -1,12 +1,9 @@
-
-
 popup_dialog.popup_settings:
   path: '/admin/config/popup_dialog/popupsettings'
   defaults:
     _form: '\Drupal\popup_dialog\Form\PopupSettingsForm'
     _title: 'Popup Dialog Settings Form'
   requirements:
-    _permission: 'access administration pages'
+    _permission: 'administer site configuration'
   options:
     _admin_route: TRUE
-
diff --git a/src/Form/PopupSettingsForm.php b/src/Form/PopupSettingsForm.php
index 211acac..0ca0d8c 100644
--- a/src/Form/PopupSettingsForm.php
+++ b/src/Form/PopupSettingsForm.php
@@ -34,46 +34,46 @@ class PopupSettingsForm extends ConfigFormBase {
    */
   public function buildForm(array $form, FormStateInterface $form_state) {
     $config = $this->config('popup_dialog.settings');
-    $form['popup_enabled'] = array(
+    $form['popup_enabled'] = [
       '#type' => 'checkbox',
       '#title' => $this->t('Enabled'),
       '#description' => $this->t('Popup will be enabled when the checkbox is active.'),
       '#default_value' => $config->get('popup_enabled'),
-    );
-    $form['popup_settings'] = array(
+    ];
+    $form['popup_settings'] = [
       '#type' => 'details',
       '#title' => $this->t('Popup Box Settings'),
       '#open' => TRUE,
-    );
+    ];
     $category_settings = !empty($config->get('category_settings')) ? $config->get('category_settings') : 1;
-    $form['popup_settings']['category_settings'] = array(
+    $form['popup_settings']['category_settings'] = [
       '#type' => 'radios',
       '#title' => 'Category Settings',
-      '#options' => array(
-        '1' => 'Custom Content',
-        '2' => 'Blocks',
-        '3' => 'Views'
-      ),
+      '#options' => [
+        '1' => $this->t('Custom Content'),
+        '2' => $this->t('Blocks'),
+        '3' => $this->t('Views'),
+      ],
       '#default_value' => $category_settings,
-    );
-    $form['popup_settings']['custom_content'] = array(
+    ];
+    $form['popup_settings']['custom_content'] = [
       '#type' => 'details',
       '#title' => $this->t('Custom Content'),
       '#open' => TRUE,
-      '#states' => array(
-        'visible' => array(
-          ':input[name="category_settings"]' => array('value' => '1'),
-        ),
-      ),
-    );
-    $form['popup_settings']['custom_content']['popup_box_title'] = array(
+      '#states' => [
+        'visible' => [
+          ':input[name="category_settings"]' => ['value' => '1'],
+        ],
+      ],
+    ];
+    $form['popup_settings']['custom_content']['popup_box_title'] = [
       '#type' => 'textfield',
       '#title' => $this->t('Title'),
       '#description' => $this->t('The title for the popup dialog box.'),
       '#maxlength' => 64,
       '#size' => 64,
       '#default_value' => $config->get('popup_box_title'),
-    );
+    ];
     $form['popup_settings']['custom_content']['popup_box_body'] = [
       '#type' => 'text_format',
       '#title' => $this->t('Body'),
@@ -81,28 +81,28 @@ class PopupSettingsForm extends ConfigFormBase {
       '#format' => $config->get('popup_box_body')['format'],
     ];
 
-    //List of blocks
+    // List of blocks.
     $blockManager = \Drupal::service('plugin.manager.block');
     $contextRepository = \Drupal::service('context.repository');
 
-    // Get blocks definition
+    // Get blocks definition.
     $definitions = $blockManager->getDefinitionsForContexts($contextRepository->getAvailableContexts());
     $definitions = $blockManager->getSortedDefinitions($definitions);
     foreach ($definitions as $plugin_id => $plugin_definition) {
       $title = (string) $plugin_definition['admin_label'];
-      $list_of_blocks[$plugin_id.'|'.$title] = (string) $title;
+      $list_of_blocks[$plugin_id . '|' . $title] = (string) $title;
     }
 
-    $form['popup_settings']['blocks'] = array(
+    $form['popup_settings']['blocks'] = [
       '#type' => 'details',
       '#title' => $this->t('Blocks'),
       '#open' => TRUE,
-      '#states' => array(
-        'visible' => array(
-          ':input[name="category_settings"]' => array('value' => '2'),
-        ),
-      ),
-    );
+      '#states' => [
+        'visible' => [
+          ':input[name="category_settings"]' => ['value' => '2'],
+        ],
+      ],
+    ];
     $form['popup_settings']['blocks']['list_of_blocks'] = [
       '#type' => 'select',
       '#title' => 'List of Blocks',
@@ -110,19 +110,18 @@ class PopupSettingsForm extends ConfigFormBase {
       '#default_value' => $config->get('list_of_blocks'),
     ];
 
-
-    //List of views
+    // List of views.
     $list_of_views = Views::getViewsAsOptions(FALSE, 'all', NULL, FALSE, TRUE);
-    $form['popup_settings']['views'] = array(
+    $form['popup_settings']['views'] = [
       '#type' => 'details',
       '#title' => $this->t('Views'),
       '#open' => TRUE,
-      '#states' => array(
-        'visible' => array(
-          ':input[name="category_settings"]' => array('value' => '3'),
-        ),
-      ),
-    );
+      '#states' => [
+        'visible' => [
+          ':input[name="category_settings"]' => ['value' => '3'],
+        ],
+      ],
+    ];
     $form['popup_settings']['views']['list_of_views'] = [
       '#type' => 'select',
       '#title' => 'List of Views',
@@ -136,19 +135,19 @@ class PopupSettingsForm extends ConfigFormBase {
       '#default_value' => $config->get('arguments'),
     ];
 
-    $form['popup_settings']['delay'] = array(
+    $form['popup_settings']['delay'] = [
       '#type' => 'number',
       '#title' => $this->t('Delay'),
       '#description' => $this->t('Show message after the enter number of seconds. Enter 0 to show instantly.'),
       '#default_value' => $config->get('delay'),
-    );
+    ];
 
-    $form['popup_settings']['popup_top_position'] = array(
+    $form['popup_settings']['popup_top_position'] = [
       '#type' => 'number',
       '#title' => $this->t('Top Offset'),
       '#description' => $this->t('Set the offset in px how much the popup box should be away from the top edge of the screen.'),
       '#default_value' => $config->get('popup_top_position'),
-    );
+    ];
     return parent::buildForm($form, $form_state);
   }
 
@@ -165,7 +164,7 @@ class PopupSettingsForm extends ConfigFormBase {
   public function submitForm(array &$form, FormStateInterface $form_state) {
 
     parent::submitForm($form, $form_state);
-    $config = \Drupal::config('popup_dialog.settings');
+    /*$config = \Drupal::config('popup_dialog.settings');*/
     $this->config('popup_dialog.settings')
       ->set('popup_enabled', $form_state->getValue('popup_enabled'))
       ->set('category_settings', $form_state->getValue('category_settings'))
@@ -179,4 +178,4 @@ class PopupSettingsForm extends ConfigFormBase {
       ->save();
   }
 
-}
\ No newline at end of file
+}
