diff --git a/src/Plugin/Block/PollRecentBlock.php b/src/Plugin/Block/PollRecentBlock.php
index 80d2f6c28..ff11874a3 100644
--- a/src/Plugin/Block/PollRecentBlock.php
+++ b/src/Plugin/Block/PollRecentBlock.php
@@ -4,7 +4,10 @@ namespace Drupal\poll\Plugin\Block;
 
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Block\BlockBase;
+use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Session\AccountInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Provides a 'Most recent poll' block.
@@ -15,7 +18,10 @@ use Drupal\Core\Session\AccountInterface;
  *   category = @Translation("Lists (Views)")
  * )
  */
-class PollRecentBlock extends BlockBase {
+class PollRecentBlock extends BlockBase implements ContainerFactoryPluginInterface {
+
+  /** @var \Drupal\Core\Entity\EntityTypeManagerInterface  */
+  private $entityTypeManager;
 
   /**
    * {@inheritdoc}
@@ -35,7 +41,8 @@ class PollRecentBlock extends BlockBase {
    * {@inheritdoc}
    */
   public function build() {
-    $polls = \Drupal::entityManager()->getStorage('poll')->getMostRecentPoll();
+    $build = [];
+    $polls = $this->entityTypeManager->getStorage('poll')->getMostRecentPoll();
     if ($polls) {
       $poll = reset($polls);
       // If we're viewing this poll, don't show this block.
@@ -44,9 +51,36 @@ class PollRecentBlock extends BlockBase {
 //        return;
 //      }
       // @todo: new view mode using ajax
-      $output = entity_view($poll, 'block');
-      $output['#title'] = $poll->label();
-      return $output;
+      $build = $this->entityTypeManager->getViewBuilder('poll')->view($poll, 'block');
+      $build['#title'] = $poll->label();
     }
+
+    return $build;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+    return new static(
+      $configuration,
+      $plugin_id,
+      $plugin_definition,
+      $container->get('entity_type.manager')
+    );
+  }
+
+  /**
+   * PollRecentBlock constructor.
+   *
+   * @param array $configuration
+   * @param string $plugin_id
+   * @param mixed $plugin_definition
+   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
+   */
+  public function __construct($configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+    $this->entityTypeManager = $entity_type_manager;
   }
+
 }
