diff --git a/README.md b/README.md
index 3b8b705..7a54a61 100644
--- a/README.md
+++ b/README.md
@@ -3,12 +3,15 @@ webform_migrate 8.x
 
 ### About this Module
 
-This module provides migration routines from Drupal 6, Drupal 7 webforms to Drupal 8 webform.
+This module provides migration routines from Drupal 6, Drupal 7 webforms to
+Drupal 8 webform.
 
 ### Installing the Webform Migrate Module
 - webform_migrate
 
 ### Configure:
 
-- Make sure your legacy webform module is up to date. So update your D7 or D6 webform module first.
-- Copy the "migration_templates" YAML files and import them into Drupal configs either using Configuration Management UI or Drush/Drupal Console.
+- Make sure your legacy webform module is up to date. So update your D7 or D6
+  webform module first.
+- Copy the "migration_templates" YAML files and import them into Drupal configs
+  either using Configuration Management UI or Drush/Drupal Console.
diff --git a/src/Plugin/migrate/source/d6/D6Webform.php b/src/Plugin/migrate/source/d6/D6Webform.php
index 84bd2c0..e828d18 100644
--- a/src/Plugin/migrate/source/d6/D6Webform.php
+++ b/src/Plugin/migrate/source/d6/D6Webform.php
@@ -215,8 +215,8 @@ class D6Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
             $process_parents[] = $parent;
             // Use the current component as parent for the next iteration.
             $process_parents[] = $element['cid'];
-            // Reset pointers for child lists because we step in there more often
-            // with multi parents.
+            // Reset pointers for child lists because we step in there more
+            // often with multi parents.
             reset($children[$element['cid']]);
             // Move pointer so that we get the correct term the next time.
             next($children[$parent]);
diff --git a/src/Plugin/migrate/source/d7/D7Webform.php b/src/Plugin/migrate/source/d7/D7Webform.php
index 9dd4734..1cf2e8f 100644
--- a/src/Plugin/migrate/source/d7/D7Webform.php
+++ b/src/Plugin/migrate/source/d7/D7Webform.php
@@ -12,7 +12,7 @@ use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\webform\Entity\Webform;
 use Drupal\node\Entity\Node;
-use Symfony\Component\Yaml\Yaml;
+use Drupal\webform\Utility\WebformYaml;
 use Drupal\Component\Utility\Bytes;
 
 /**
@@ -182,8 +182,10 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
    * Build form elements from webform component table.
    */
   protected function buildFormElements($nid) {
-    // TODO : Use yaml_emit http://php.net/manual/en/function.yaml-emit.php
-    $output = '';
+    // Resulting array build that will be converted to YAML.
+    $build = [];
+    // Array with all elements keyed by form_key for a quick access.
+    $references = [];
 
     $query = $this->select('webform_component', 'wc');
     $query->fields('wc', [
@@ -243,7 +245,13 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
           if ($depth > 0) {
             $element['form_key'] = $element['form_key'] . '_' . $element['pid'];
           }
-          unset($element['pid']);
+
+          // Rename fieldsets to it's own unique key.
+          if ($element['type'] == 'fieldset' && strpos($element['form_key'], 'fieldset') === FALSE) {
+            $element['form_key'] = 'fieldset_' . $element['form_key'];
+          }
+          $element['form_key'] = strtolower($element['form_key']);
+
           $elements_tree[] = $element;
           if (!empty($children[$element['cid']])) {
             $has_children = TRUE;
@@ -251,8 +259,8 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
             $process_parents[] = $parent;
             // Use the current component as parent for the next iteration.
             $process_parents[] = $element['cid'];
-            // Reset pointers for child lists because we step in there more often
-            // with multi parents.
+            // Reset pointers for child lists because we step in there more
+            // often with multi parents.
             reset($children[$element['cid']]);
             // Move pointer so that we get the correct term the next time.
             next($children[$parent]);
@@ -267,20 +275,17 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
       }
     }
 
+    $parent_element = &$build;
     // If form has multiple pages then start first page automatically.
     if ($multiPage) {
-      $pageCnt = 1;
-      $current_page = 'wizard_page_1';
-      $output .= "first_page:\n  '#type': webform_wizard_page\n  '#title': {" . $current_page . "_title}\n";
-      $current_page_title = 'Start';
+      $build['first_page'] = [
+        '#type' => 'webform_wizard_page',
+        '#title' => 'Start',
+      ];
+      $parent_element = &$build['first_page'];
     }
 
     foreach ($elements_tree as $element) {
-      // Rename fieldsets to it's own unique key.
-      if ($element['type'] == 'fieldset' && strpos($element['form_key'], 'fieldset') === FALSE) {
-        $element['form_key'] = 'fieldset_' . $element['form_key'];
-      }
-
       // If this is a multi-page form then indent all elements one level
       // to allow for page elements.
       if ($multiPage && $element['type'] != 'pagebreak') {
@@ -288,38 +293,30 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
       }
       $indent = str_repeat(' ', $element['depth'] * 2);
       $extra = unserialize($element['extra']);
-      // The description key can be missing (since description is optional and
-      // it isn't saved by Drupal 7 webform when it is left empty).
-      $description = !empty($extra['description'])
-        ? $this->cleanString($extra['description'])
-        : NULL;
 
       // Create an option list if there are items for this element.
-      $options = '';
+      $options = [];
       $valid_options = [];
       if (!empty($extra['items'])) {
         $items = explode("\n", trim($extra['items']));
-        $ingroup = '';
         foreach ($items as $item) {
           $item = trim($item);
           if (!empty($item)) {
             // Handle option groups.
             if (preg_match('/^<(.*)>$/', $item, $matches)) {
               if (empty(trim($matches[1]))) {
-                $ingroup = '';
                 continue;
               }
-              $options .= "$indent    '" . $matches[1] . "':\n";
-              $ingroup = str_repeat(' ', 2);
+              $options[$matches[1]] = '';
             }
             else {
               $option = explode('|', $item);
               $valid_options[] = $option[0];
               if (count($option) == 2) {
-                $options .= "$indent$ingroup    " . $option[0] . ": '" . str_replace('\'', '"', $option[1]) . "'\n";
+                $options[$option[0]] = $option[1];
               }
               else {
-                $options .= "$indent$ingroup    " . $option[0] . ": '" . str_replace('\'', '"', $option[0]) . "'\n";
+                $options[$option[0]] = $option[0];
               }
             }
           }
@@ -331,24 +328,47 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
         $element['value'] = $this->replaceTokens($element['value']);
       }
 
-      $markup = $indent . strtolower($element['form_key']) . ":\n";
+      // Let's find out the parent for the given element.
+      if (!empty($element['pid']) && !empty($elements[$element['pid']]['form_key'])) {
+        $parent_key = $elements[$element['pid']]['form_key'];
+        if (!empty($references[$parent_key])) {
+          $parent_element = &$references[$parent_key];
+        }
+      }
+      elseif ($multiPage && $element['type'] !== 'pagebreak') {
+        // If previous item was a page, use it as parent element.
+        // Otherwise, use previous parent.
+        if (!empty($new_element['#type']) && $new_element['#type'] === 'webform_wizard_page') {
+          $parent_element = &$new_element;
+        }
+      }
+      else {
+        $parent_element = &$build;
+      }
+
+      $form_key = $element['form_key'];
+      $new_element = &$parent_element[$form_key];
+      $references[$form_key] = &$new_element;
       switch ($element['type']) {
         case 'fieldset':
-          if ($multiPage && empty($current_page_title)) {
-            $current_page_title = $element['name'];
+          $new_element = [
+            '#type' => 'fieldset',
+            '#open' => TRUE,
+          ];
+          if ($multiPage && $parent_element['#type'] === 'webform_wizard_page' && empty($parent_element['#title'])) {
+            $parent_element['#title'] = $element['name'];
           }
-          $markup .= "$indent  '#type': fieldset\n$indent  '#open': true\n";
           break;
 
         case 'textfield':
-          $markup .= "$indent  '#type': textfield\n";
+          $new_element['#type'] = 'textfield';
           if (!empty($extra['width'])) {
-            $markup .= "$indent  '#size': " . (int) $extra['width'] . "\n";
+            $new_element['#size'] = (int) $extra['width'];
           }
           break;
 
         case 'textarea':
-          $markup .= "$indent  '#type': textarea\n";
+          $new_element['#type'] = 'textarea';
           break;
 
         case 'select':
@@ -360,54 +380,64 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
           }
           elseif (!empty($extra['multiple']) && count($valid_options) == 1) {
             $select_type = 'checkbox';
-            list($key, $desc) = explode('|', $extra['items']);
-            $markup .= "$indent  '#description': \"" . $this->cleanString($desc) . "\"\n";
           }
           else {
             $select_type = 'radios';
           }
-          $markup .= "$indent  '#type': $select_type\n";
-          $markup .= "$indent  '#options':\n" . $options;
+
+          $new_element = [
+            '#type' => $select_type,
+            '#options' => $options,
+          ];
+
           if (!empty($extra['multiple'])) {
-            $markup .= "$indent  '#multiple': true\n";
+            $new_element['#multiple'] = TRUE;
           }
           break;
 
         case 'email':
-          $markup .= "$indent  '#type': email\n$indent  '#size': 20\n";
+          $new_element = [
+            '#type' => 'email',
+            '#size' => 20,
+          ];
           break;
 
         case 'number':
           if ($extra['type'] == 'textfield') {
-            $markup .= "$indent  '#type': textfield\n$indent  '#size': 20\n";
+            $new_element = [
+              '#type' => 'textfield',
+              '#size' => 20,
+            ];
           }
           elseif ($extra['type'] == 'select') {
-            $markup .= "$indent  '#type': select\n";
-            $markup .= "$indent  '#options':\n" . $options;
+            $new_element = [
+              '#type' => 'select',
+              '#options' => $options,
+            ];
+
             $min = $extra['min'];
             $max = $extra['max'];
             $step = !empty($extra['step']) ? $extra['step'] : 1;
             for ($value = $min; $value <= $max; $value += $step) {
-              $markup .= "$indent    " . $value . ": " . $value . "\n";
+              $new_element[$value] = $value;
             }
           }
-          if (!empty($extra['min'])) {
-            $markup .= "$indent  '#min': " . $extra['min'] . "\n";
-          }
-          if (!empty($extra['max'])) {
-            $markup .= "$indent  '#max': " . $extra['max'] . "\n";
-          }
-          if (!empty($extra['step'])) {
-            $markup .= "$indent  '#step': " . $extra['step'] . "\n";
+          foreach (['min', 'max', 'step'] as $property) {
+            if (!empty($extra[$property])) {
+              $new_element["#{$property}"] = $extra[$property];
+            }
           }
           if (isset($extra['unique'])) {
-            $unique = ($extra['unique']) ? 'true' : 'false';
-            $markup .= "$indent  '#unique': " . $unique . "\n";
+            $new_element['#unique'] = (bool) $extra['unique'];
           }
           break;
 
         case 'markup':
-          $markup .= "$indent  '#type': processed_text\n$indent  '#format': full_html\n$indent  '#text': \"" . $this->cleanString($element['value']) . "\"\n";
+          $new_element = [
+            '#type' => 'processed_text',
+            '#format' => 'full_html',
+            '#text' => trim($element['value']),
+          ];
           $element['value'] = '';
           break;
 
@@ -438,135 +468,115 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
             $file_size = ($file_size < 1) ? 1 : $file_size;
           }
 
-          $markup .= "$indent  '#type': managed_file\n";
-          $markup .= "$indent  '#max_filesize': '$file_size'\n";
-          $markup .= "$indent  '#file_extensions': '$exts'\n";
+          $new_element = [
+            '#type' => 'managed_file',
+            '#max_filesize' => $file_size,
+            '#file_extensions' => $exts,
+          ];
 
           if (!empty($extra['width'])) {
-            $markup .= "$indent  '#size': " . $extra['width'] . "\n";
+            $new_element['#size'] = $extra['width'];
           }
-
           if ($element['type'] == 'multiple_file') {
-            $markup .= "$indent  '#multiple': true\n";
+            $new_element['#multiple'] = TRUE;
           }
           break;
 
         case 'date':
-          $markup .= "$indent  '#type': date\n";
-          /*if (!empty($element['value'])) {
-          $element['value'] = date('Y-m-d', strtotime($element['value']));
-          }*/
+          $new_element['#type'] = 'date';
           break;
 
         case 'time':
-          $markup .= "$indent  '#type': webform_time\n";
+          $new_element['#type'] = 'webform_time';
+
           if (!empty($extra['hourformat'])) {
             if ($extra['hourformat'] == '12-hour') {
-              $markup .= "$indent  '#time_format': 'g:i A'\n";
+              $new_element['#time_format'] = 'g:i A';
             }
             elseif ($extra['hourformat'] == '24-hour') {
-              $markup .= "$indent  '#time_format': 'H:i'\n";
+              $new_element['#time_format'] = 'H:i';
             }
           }
 
           if (!empty($extra['minuteincrements'])) {
             // Setting expects seconds not minutes.
-            $step = (int)$extra['minuteincrements'] * 60;
-            $markup .= "$indent  '#step': $step\n";
+            $step = (int) $extra['minuteincrements'] * 60;
+            $new_element['#step'] = $step;
           }
-
-          /*if (!empty($element['value'])) {
-          $element['value'] = date('c', strtotime($element['value']));
-          }*/
           break;
 
         case 'hidden':
-          $markup .= "$indent  '#type': hidden\n";
+          $new_element['#type'] = 'hidden';
           break;
 
         case 'pagebreak':
-          $output = str_replace('{' . $current_page . '_title}', $current_page_title, $output);
-          $current_page = $element['form_key'];
-          $markup .= "$indent  '#type': webform_wizard_page\n  '#title': {" . $current_page . "_title}\n";
-          $current_page_title = $element['name'];
-          $pageCnt++;
+          $new_element = [
+            '#type' => 'webform_wizard_page',
+            '#title' => $element['name'],
+          ];
           break;
 
         case 'addressfield':
-          $markup .= "$indent  '#type': webform_address\n";
-          $markup .= "$indent  '#state_province__type': textfield\n";
+          $new_element['#type'] = 'webform_address';
+          $new_element['#state_province__type'] = 'textfield';
           break;
 
         case 'grid':
-          $questionsArray = $this->getItemsArray($extra['questions']);
-          $questions = $this->buildItemsString($questionsArray, $indent . '  ');
-
-          $answersArray = $this->getItemsArray($extra['options']);
-          $answers = $this->buildItemsString($answersArray, $indent . '  ');
-
-          $markup .= "$indent  '#type': webform_likert\n";
-          $markup .= "$indent  '#questions':\n" . $questions . "\n";
-          $markup .= "$indent  '#answers':\n" . $answers . "\n";
+          $questions = $this->getItemsArray($extra['questions']);
+          $new_element['#type'] = 'webform_likert';
+          $new_element['#questions'] = $questions;
+          $new_element['#answers'] = $this->getItemsArray($extra['options']);
           break;
 
         default:
-          echo '';
+          // @todo We should make some notice if element type was not found.
+          break;
       }
 
+      // Continue passing element markup to make it less breaking change.
       if (!empty($element['type']) && is_string($element['type'])) {
-        $this->getModuleHandler()->alter('webform_migrate_d7_webform_element_' . $element['type'], $markup, $indent, $element);
+        $element_markup = !empty($new_element) ? WebformYaml::encode($new_element) : '';
+        $this->getModuleHandler()->alter('webform_migrate_d7_webform_element_' . $element['type'], $element_markup, $indent, $element);
+        $new_element = WebformYaml::decode($element_markup);
       }
 
       // Add common fields.
       if (!empty(trim($element['value'])) && (empty($valid_options) || in_array($element['value'], $valid_options))) {
-        $markup .= "$indent  '#default_value': '" . str_replace(array('\'', "\n", "\r"), array('"', '\n', ''), trim($element['value'])) . "'\n";
+        $new_element['#default_value'] = trim($element['value']);
       }
       if (!empty($extra['field_prefix'])) {
-        $markup .= "$indent  '#field_prefix': " . $extra['field_prefix'] . "\n";
+        $new_element['#field_prefix'] = $extra['field_prefix'];
       }
       if (!empty($extra['field_suffix'])) {
-        $markup .= "$indent  '#field_suffix': " . $extra['field_suffix'] . "\n";
+        $new_element['#field_suffix'] = $extra['field_suffix'];
       }
       if (!empty($extra['title_display']) && $extra['title_display'] != 'before') {
         $title_display = $extra['title_display'];
         if ($title_display == 'none') {
           $title_display = 'invisible';
         }
-        $markup .= "$indent  '#title_display': " . $title_display . "\n";
+        $new_element['#title_display'] = $title_display;
       }
       if ($element['type'] != 'pagebreak') {
-        $markup .= "$indent  '#title': '" . str_replace('\'', '"', $element['name']) . "'\n";
-        $markup .= "$indent  '#description': \"" . $description . "\"\n";
+        $new_element['#title'] = $element['name'];
+
+        // The description key can be missing (since description is optional and
+        // it isn't saved by Drupal 7 webform when it is left empty).
+        if (!empty($extra['description'])) {
+          $new_element['#description'] = $extra['description'];
+        }
       }
       if (!empty($element['required'])) {
-        $markup .= "$indent  '#required': true\n";
+        $new_element['#required'] = TRUE;
       }
 
-      // Build contionals.
+      // Attach conditionals as Drupal #states.
       if ($states = $this->buildConditionals($element, $elements)) {
-        $markup .= "$indent  '#states':\n";
-        foreach ($states as $key => $values) {
-          $markup .= "$indent    $key:\n";
-          foreach ($values as $value) {
-            foreach ($value as $name => $item) {
-              $markup .= "$indent      " . Yaml::dump($name, 2, 2) . ":\n";
-              foreach (explode("\n", Yaml::dump($item, 2, 2)) as $line) {
-                if (!empty($line)) {
-                  $markup .= "$indent        " . $line . "\n";
-                }
-              }
-            }
-          }
-        }
+        $new_element['#states'] = $states;
       }
-
-      $output .= $markup;
     }
 
-    if ($multiPage) {
-      // Replace the final page title.
-      $output = str_replace('{' . $current_page . '_title}', $current_page_title, $output);
-    }
+    $output = WebformYaml::encode($build);
     return ['elements' => $output, 'xref' => $xref];
   }
 
@@ -965,22 +975,51 @@ class D7Webform extends DrupalSqlBase implements ImportAwareInterface, RollbackA
     }
   }
 
+  /**
+   * @todo Add documentation.
+   *
+   * @param string $rawString
+   *   @todo Add documentation.
+   *
+   * @return array
+   *   @todo Add documentation.
+   */
   protected function getItemsArray($rawString) {
     $items = explode("\n", $rawString);
     $items = array_map('trim', $items);
-    return array_map(function($item) {
+    return array_map(function ($item) {
       return explode('|', $item);
     }, $items);
   }
 
-  protected function buildItemsString($itemsArray, $baseIndent = '') {
-    $preparedItems = array_map(function($item) use ($baseIndent) {
+  /**
+   * @todo Add documentation.
+   *
+   * @param array $itemsArray
+   *   @todo Add documentation.
+   * @param string $baseIndent
+   *   @todo Add documentation.
+   *
+   * @return string
+   *   @todo Add documentation.
+   */
+  protected function buildItemsString(array $itemsArray, $baseIndent = '') {
+    $preparedItems = array_map(function ($item) use ($baseIndent) {
       return $baseIndent . '  ' . $this->encapsulateString($item[0]) . ': ' . $this->encapsulateString($item[1]);
     }, $itemsArray);
 
     return implode("\n", $preparedItems);
   }
 
+  /**
+   * @todo Add documentation.
+   *
+   * @param string $string
+   *   @todo Add documentation.
+   *
+   * @return string
+   *   @todo Add documentation.
+   */
   protected function encapsulateString($string) {
     return sprintf("'%s'", addslashes($string));
   }
diff --git a/src/Plugin/migrate/source/d7/D7WebformSubmission.php b/src/Plugin/migrate/source/d7/D7WebformSubmission.php
index 135b5ec..787ff79 100644
--- a/src/Plugin/migrate/source/d7/D7WebformSubmission.php
+++ b/src/Plugin/migrate/source/d7/D7WebformSubmission.php
@@ -83,9 +83,9 @@ class D7WebformSubmission extends DrupalSqlBase {
     $query->innerJoin('webform_component', 'wc', 'wc.nid=wfsd.nid AND wc.cid=wfsd.cid');
 
     $query->fields('wfsd', [
-        'no',
-        'data',
-      ])
+      'no',
+      'data',
+    ])
       ->fields('wc', [
         'form_key',
         'extra',
diff --git a/tests/fixtures/README.md b/tests/fixtures/README.md
index 814bac3..9049dba 100644
--- a/tests/fixtures/README.md
+++ b/tests/fixtures/README.md
@@ -9,7 +9,8 @@ cases and re-export the database and the new files back to code.
 
 ## Requirements
 
-- Alias for the source database's Drupal 7 instance: `drupal7-webform.localhost`.
+- Alias for the source database's Drupal 7 instance:
+`drupal7-webform.localhost`.
 
 - A Drupal 8|9 codebase for the database import-export script.
 
@@ -50,7 +51,8 @@ a Drupal 8|9 instance. You can skip the _Set up Drupal 6 / 7 installation that
 uses your test database_ section since it is replaced by the make files
 we provide.
 
-- If it does not exist, create a new database with name `drupal7_webform` for the Drupal 7 source instance.
+- If it does not exist, create a new database with name `drupal7_webform` for
+  the Drupal 7 source instance.
 
   - `mysql -u <user> -p -e "CREATE DATABASE drupal7_webform DEFAULT CHARACTER SET = 'utf8' DEFAULT COLLATE 'utf8_general_ci';"`
   - `mysql -u <user> -p -e "grant ALL privileges on drupal7_webform.* to 'devuser'@'localhost';"`
diff --git a/tests/src/Kernel/Migrate/d7/WebformMigrateTestBase.php b/tests/src/Kernel/Migrate/d7/WebformMigrateTestBase.php
index 74ed7b8..9085103 100644
--- a/tests/src/Kernel/Migrate/d7/WebformMigrateTestBase.php
+++ b/tests/src/Kernel/Migrate/d7/WebformMigrateTestBase.php
@@ -7,6 +7,8 @@ use Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase;
 
 /**
  * Base class for Webform migration kernel tests.
+ *
+ * @requires module webform
  */
 abstract class WebformMigrateTestBase extends MigrateDrupalTestBase {
 
diff --git a/tests/src/Traits/WebformMigrateAssertionsTrait.php b/tests/src/Traits/WebformMigrateAssertionsTrait.php
index 464c7b3..6a7062d 100644
--- a/tests/src/Traits/WebformMigrateAssertionsTrait.php
+++ b/tests/src/Traits/WebformMigrateAssertionsTrait.php
@@ -60,122 +60,116 @@ trait WebformMigrateAssertionsTrait {
     '#type': textfield
     '#size': 100
     '#title': 'Title (as textfield)'
-    '#description': \"Required, no default value, no conditions.\\nIf the title contains <code>fieldset</code>, then a fieldset will appear.\"
+    '#description': |
+      Required, no default value, no conditions.
+      If the title contains <code>fieldset</code>, then a fieldset will appear.
     '#required': true
   date:
     '#type': date
-    '#title': 'Date'
-    '#description': \"Optional, no default value, website timezone.\"
+    '#title': Date
+    '#description': 'Optional, no default value, website timezone.'
   email:
     '#type': email
     '#size': 20
     '#default_value': '[current-user:mail]'
     '#title_display': invisible
-    '#title': 'E-mail'
-    '#description': \"No label; user email as default; long format ('Example Name' <name@example.com>) can be used.\"
+    '#title': E-mail
+    '#description': 'No label; user email as default; long format (\"Example Name\" <name@example.com>) can be used.'
   file_attachment:
     '#type': managed_file
-    '#max_filesize': '2'
+    '#max_filesize': !!float 2
     '#file_extensions': 'gif jpg jpeg png eps txt rtf html pdf doc docx odt ppt pptx odp xls xlsx ods xml ps'
     '#title': 'File attachment'
-    '#description': \"\"
   fieldset:
     '#type': fieldset
     '#open': true
-    '#title': 'Fieldset'
-    '#description': \"\"
+    '#title': Fieldset
     '#states':
       visible:
-        ':input[name=\"title_as_textfield\"]':
-          value:
-            pattern: fieldset
+        - ':input[name=\"title_as_textfield\"]':
+            value:
+              pattern: fieldset
     hidden_value_5:
       '#type': hidden
       '#default_value': 'hidden value of \"hidden_value\"'
       '#title': 'Hidden value'
-      '#description': \"\"
     select_multi_nested_5:
       '#type': select
       '#options':
         a: 'Option A'
         b: 'Option B'
-        'Group A':
-          aa: 'Option AA'
-          ab: 'Option AB'
-        'Group B':
-          ba: 'Option BA'
-          bb: 'Option BB'
+        'Group A': ''
+        aa: 'Option AA'
+        ab: 'Option AB'
+        'Group B': ''
+        ba: 'Option BA'
+        bb: 'Option BB'
         c: 'Option C'
       '#multiple': true
       '#title': 'Select options (multiple, nested)'
-      '#description': \"\"
-  text_markup:
-    '#type': processed_text
-    '#format': full_html
-    '#text': \"Some <strong>text</strong> with <code>filtered_html</code>, displayed only on the form.\"
-    '#title': 'Text markup'
-    '#description': \"\"
-  number:
-    '#type': textfield
-    '#size': 20
-    '#min': 10
-    '#max': 3000
-    '#unique': false
-    '#title': 'Number'
-    '#description': \"An integer between 10 and 3000.\"
-    '#required': true
-  radios:
-    '#type': radios
-    '#options':
-      tuesday: 'Tuesday'
-      wednesday: 'Wednesday'
-      thursday: 'Thursday'
-      friday: 'Friday'
-      saturday: 'Saturday'
-      sunday: 'Sunday'
-    '#default_value': 'wednesday'
-    '#title': 'Radios'
-    '#description': \"Select the best day of the week\"
-    '#required': true
+    text_markup:
+      '#type': processed_text
+      '#format': full_html
+      '#text': 'Some <strong>text</strong> with <code>filtered_html</code>, displayed only on the form.'
+      '#title': 'Text markup'
+    number:
+      '#type': textfield
+      '#size': 20
+      '#min': '10'
+      '#max': '3000'
+      '#unique': false
+      '#title': Number
+      '#description': 'An integer between 10 and 3000.'
+      '#required': true
+    radios:
+      '#type': radios
+      '#options':
+        tuesday: Tuesday
+        wednesday: Wednesday
+        thursday: Thursday
+        friday: Friday
+        saturday: Saturday
+        sunday: Sunday
+      '#default_value': wednesday
+      '#title': Radios
+      '#description': 'Select the best day of the week'
+      '#required': true
 page_break:
   '#type': webform_wizard_page
-  '#title': Page break
+  '#title': 'Page break'
   checkboxes:
     '#type': checkboxes
     '#options':
-      AF: 'Afghanistan'
+      AF: Afghanistan
       AX: 'Aland Islands'
-      AL: 'Albania'
-      DZ: 'Algeria'
+      AL: Albania
+      DZ: Algeria
       AS: 'American Samoa'
-      AD: 'Andorra'
-      AO: 'Angola'
-      AI: 'Anguilla'
-      AQ: 'Antarctica'
+      AD: Andorra
+      AO: Angola
+      AI: Anguilla
+      AQ: Antarctica
       AG: 'Antigua and Barbuda'
-      AR: 'Argentina'
-      AM: 'Armenia'
-      AW: 'Aruba'
-      AU: 'Australia'
-      AT: 'Austria'
-      AZ: 'Azerbaijan'
-      ZM: 'Zambia'
-      ZW: 'Zimbabwe'
+      AR: Argentina
+      AM: Armenia
+      AW: Aruba
+      AU: Australia
+      AT: Austria
+      AZ: Azerbaijan
+      ZM: Zambia
+      ZW: Zimbabwe
     '#multiple': true
-    '#title': 'Checkboxes'
-    '#description': \"Countries you want to travel to (only A and Z)\"
+    '#title': Checkboxes
+    '#description': 'Countries you want to travel to (only A and Z)'
   textarea:
     '#type': textarea
-    '#title': 'Textarea'
-    '#description': \"\"
+    '#title': Textarea
   time:
     '#type': webform_time
     '#time_format': 'H:i'
     '#step': 60
     '#title_display': inline
-    '#title': 'Time'
-    '#description': \"\"
-",
+    '#title': Time",
       'css' => '',
       'javascript' => '',
       'settings' => [
@@ -230,19 +224,36 @@ page_break:
       'elements' => "grid:
   '#type': webform_likert
   '#questions':
-    'd7_sitebuild': 'How much you value Drupal 7 in terms of site building capabilities?'
-    'd7_theming': 'How much you value Drupal 7 in terms of theme development?'
-    'd7_backend': 'How much you value Drupal 7 in terms of module development?'
-    'd9_sitebuild': 'How much you value Drupal 8 or Drupal 9 in terms of site building capabilities?'
-    'd9_theming': 'How much you value Drupal 8 or Drupal 9 in terms of theme development?'
-    'd9_backend': 'How much you value Drupal 8 or Drupal 9 in terms of module development?'
+    -
+      - d7_sitebuild
+      - 'How much you value Drupal 7 in terms of site building capabilities?'
+    -
+      - d7_theming
+      - 'How much you value Drupal 7 in terms of theme development?'
+    -
+      - d7_backend
+      - 'How much you value Drupal 7 in terms of module development?'
+    -
+      - d9_sitebuild
+      - 'How much you value Drupal 8 or Drupal 9 in terms of site building capabilities?'
+    -
+      - d9_theming
+      - 'How much you value Drupal 8 or Drupal 9 in terms of theme development?'
+    -
+      - d9_backend
+      - 'How much you value Drupal 8 or Drupal 9 in terms of module development?'
   '#answers':
-    'hard': 'Hard'
-    'neutral': 'Not too hard, but can be easier'
-    'easy': 'Easy'
-  '#title': 'Grid'
-  '#description': \"Please evaluate how Drupal fits your needs\"
-",
+    -
+      - hard
+      - Hard
+    -
+      - neutral
+      - 'Not too hard, but can be easier'
+    -
+      - easy
+      - Easy
+  '#title': Grid
+  '#description': 'Please evaluate how Drupal fits your needs'",
       'css' => '',
       'javascript' => '',
       'settings' => [
@@ -300,11 +311,11 @@ page_break:
     drip_brew: 'Drip Brew'
     pour_over: 'Pour Over'
     cold_brew: 'Cold Brew'
-    espresso: 'Espresso'
-    ristretto: 'Ristretto'
+    espresso: Espresso
+    ristretto: Ristretto
   '#multiple': true
   '#title': 'Brewing Styles'
-  '#description': \"Brewing styles you like\"
+  '#description': 'Brewing styles you like'
 drinks:
   '#type': checkboxes
   '#options':
@@ -313,23 +324,22 @@ drinks:
     red_eye: 'Red Eye'
     black_eye: 'Black Eye'
     long_black: 'Long Black'
-    macchiato: 'Macchiato'
+    macchiato: Macchiato
     long_macchiato: 'Long Macchiato'
-    cortado: 'Cortado'
-    breve: 'Breve'
-    cappuccino: 'Cappuccino'
+    cortado: Cortado
+    breve: Breve
+    cappuccino: Cappuccino
     flat_white: 'Flat White'
     cafe_latte: 'Cafe Latte'
-    mocha: 'Mocha'
-    vienna: 'Vienna'
-    affogato: 'Affogato'
+    mocha: Mocha
+    vienna: Vienna
+    affogato: Affogato
     cafe_au_lait: 'Cafe au Lait'
     iced_coffee: 'Iced Coffee'
   '#multiple': true
-  '#title': 'Drinks'
-  '#description': \"Please choose the coffee styles you like\"
-  '#required': true
-",
+  '#title': Drinks
+  '#description': 'Please choose the coffee styles you like'
+  '#required': true",
       'css' => '',
       'javascript' => '',
       'settings' => [
diff --git a/webform_migrate.api.php b/webform_migrate.api.php
index ff763f5..de49988 100644
--- a/webform_migrate.api.php
+++ b/webform_migrate.api.php
@@ -13,8 +13,6 @@
 /**
  * Alters the markup of webform element during migration from Drupal 7.
  *
- * @See \Drupal\webform_migrate\Plugin\migrate\source\d7\D7Webform::buildFormElements()
- *
  * @param string $markup
  *   Webform element yaml markup string.
  * @param string $indent
@@ -22,6 +20,8 @@
  * @param array $element
  *   Prepared array of webform element from migration source, keyed on
  *   the machine-readable element name.
+ *
+ * @see \Drupal\webform_migrate\Plugin\migrate\source\d7\D7Webform::buildFormElements()
  */
 function hook_webform_migrate_d7_webform_element_ELEMENT_TYPE_alter(&$markup, $indent, array $element) {
   // Define custom webform element type from contrib or custom module.
@@ -34,8 +34,6 @@ function hook_webform_migrate_d7_webform_element_ELEMENT_TYPE_alter(&$markup, $i
 /**
  * Alters the markup of webform element during migration from Drupal 6.
  *
- * @See \Drupal\webform_migrate\Plugin\migrate\source\d6\D6Webform::buildFormElements()
- *
  * @param string $markup
  *   Webform element yaml markup string.
  * @param string $indent
@@ -43,6 +41,8 @@ function hook_webform_migrate_d7_webform_element_ELEMENT_TYPE_alter(&$markup, $i
  * @param array $element
  *   Prepared array of webform element from migration source, keyed on
  *   the machine-readable element name.
+ *
+ * @see \Drupal\webform_migrate\Plugin\migrate\source\d6\D6Webform::buildFormElements()
  */
 function hook_webform_migrate_d6_webform_element_ELEMENT_TYPE_alter(&$markup, $indent, array $element) {
   // Define custom webform element type from contrib or custom module.
