diff --git a/core/modules/tour/src/Entity/Tour.php b/core/modules/tour/src/Entity/Tour.php
index 55b94f1..4a246a5 100644
--- a/core/modules/tour/src/Entity/Tour.php
+++ b/core/modules/tour/src/Entity/Tour.php
@@ -34,21 +34,21 @@ class Tour extends ConfigEntityBase implements TourInterface {
    *
    * @var string
    */
-  public $id;
+  protected $id;
 
   /**
    * The module which this tour is assigned to.
    *
    * @var string
    */
-  public $module;
+  protected $module;
 
   /**
    * The label of the tour.
    *
    * @var string
    */
-  public $label;
+  protected $label;
 
   /**
    * The routes on which this tour should be displayed.
@@ -123,6 +123,13 @@ public function getTips() {
   /**
    * {@inheritdoc}
    */
+  public function getModule() {
+    return $this->module;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function hasMatchingRoute($route_name, $route_params) {
     if (!isset($this->keyedRoutes)) {
       $this->keyedRoutes = array();
diff --git a/core/modules/tour/src/TourInterface.php b/core/modules/tour/src/TourInterface.php
index 2aa1459..d8c98d4 100644
--- a/core/modules/tour/src/TourInterface.php
+++ b/core/modules/tour/src/TourInterface.php
@@ -55,6 +55,14 @@ public function getTip($id);
   public function getTips();
 
   /**
+   * Gets the module this tour belongs to.
+   *
+   * @return string
+   *   The module this tour belongs to.
+   */
+  public function getModule();
+
+  /**
    * Resets the statically cached keyed routes.
    */
   public function resetKeyedRoutes();
diff --git a/core/modules/tour/src/TourViewBuilder.php b/core/modules/tour/src/TourViewBuilder.php
index 4f3006e..fc68a24 100644
--- a/core/modules/tour/src/TourViewBuilder.php
+++ b/core/modules/tour/src/TourViewBuilder.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityViewBuilder;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Component\Utility\Html;
 
 /**
  * Provides a Tour view builder.
@@ -28,9 +29,9 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la
         if ($output = $tip->getOutput()) {
           $attributes = array(
             'class' => array(
-              'tip-module-' . drupal_clean_css_identifier($entity->get('module')),
-              'tip-type-' . drupal_clean_css_identifier($tip->get('plugin')),
-              'tip-' . drupal_clean_css_identifier($tip->get('id')),
+              'tip-module-' . Html::cleanCssIdentifier($entity->getModule()),
+              'tip-type-' . Html::cleanCssIdentifier($tip->get('plugin')),
+              'tip-' . Html::cleanCssIdentifier($tip->get('id')),
             ),
           );
           $list_items[] = array(
