diff --git a/flag.module b/flag.module
index 51bdd1a..95506da 100644
--- a/flag.module
+++ b/flag.module
@@ -220,7 +220,7 @@ function flag_lazy_link_builder($entity_type_id, $entity_id, $flag_id) {
   // Only display if the user does have access.
   if ($flag->hasActionAccess($action)) {
     $link_type_plugin = $flag->getLinkTypePlugin();
-    $link = $link_type_plugin->renderLink($action, $flag, $entity);
+    $link = $link_type_plugin->renderLink($flag, $entity);
     // The actual render array must be in a nested key, due to a bug in
     // lazy builder handling that does not properly render top-level #type
     // elements.
diff --git a/src/ActionLinkTypeBase.php b/src/ActionLinkTypeBase.php
index f10e1a2..5a910a6 100644
--- a/src/ActionLinkTypeBase.php
+++ b/src/ActionLinkTypeBase.php
@@ -80,7 +80,10 @@ abstract class ActionLinkTypeBase extends PluginBase implements ActionLinkTypePl
   /**
    * {@inheritdoc}
    */
-  public function renderLink($action, FlagInterface $flag, EntityInterface $entity) {
+  public function renderLink(FlagInterface $flag, EntityInterface $entity) {
+
+    $action = $flag->isFlagged($entity) ? 'unflag' : 'flag';
+
     $url = $this->buildLink($action, $flag, $entity);
 
     $url->setRouteParameter('destination', $this->getDestination());
diff --git a/src/ActionLinkTypePluginInterface.php b/src/ActionLinkTypePluginInterface.php
index ae66721..1748d2a 100644
--- a/src/ActionLinkTypePluginInterface.php
+++ b/src/ActionLinkTypePluginInterface.php
@@ -34,8 +34,6 @@ interface ActionLinkTypePluginInterface extends PluginFormInterface, Configurabl
   /**
    * Generates a flag link as a render array.
    *
-   * @param string $action
-   *   The action to perform, 'flag' and 'unflag'.
    * @param FlagInterface $flag
    *   The flag entity.
    * @param EntityInterface $entity
@@ -44,5 +42,5 @@ interface ActionLinkTypePluginInterface extends PluginFormInterface, Configurabl
    * @return array
    *   A render array of the flag link.
    */
-  public function renderLink($action, FlagInterface $flag, EntityInterface $entity);
+  public function renderLink(FlagInterface $flag, EntityInterface $entity);
 }
diff --git a/src/Controller/AJAXLinkController.php b/src/Controller/AJAXLinkController.php
index f1ebc9d..4829aed 100644
--- a/src/Controller/AJAXLinkController.php
+++ b/src/Controller/AJAXLinkController.php
@@ -43,7 +43,7 @@ class AJAXLinkController extends ControllerBase {
       // Fail silently and return the updated link.
     }
 
-    return $this->generateResponse('unflag', $flag, $entity);
+    return $this->generateResponse($flag, $entity);
   }
 
   /**
@@ -72,14 +72,12 @@ class AJAXLinkController extends ControllerBase {
       // Fail silently and return the updated link.
     }
 
-    return $this->generateResponse('flag', $flag, $entity);
+    return $this->generateResponse($flag, $entity);
   }
 
   /**
    * Generates a response object after handing the un/flag request.
    *
-   * @param string $action
-   *   The action being performed, should be 'flag' or 'unflag'.
    * @param FlagInterface $flag
    *   The flag entity.
    * @param EntityInterface $entity
@@ -88,7 +86,7 @@ class AJAXLinkController extends ControllerBase {
    * @return AjaxResponse
    *   The response object.
    */
-  protected function generateResponse($action, FlagInterface $flag, EntityInterface $entity) {
+  protected function generateResponse(FlagInterface $flag, EntityInterface $entity) {
     // Create a new AJAX response.
     $response = new AjaxResponse();
 
@@ -96,7 +94,7 @@ class AJAXLinkController extends ControllerBase {
     $link_type = $flag->getLinkTypePlugin();
 
     // Generate the link render array and get the link CSS ID.
-    $link = $link_type->renderLink($action, $flag, $entity);
+    $link = $link_type->renderLink($flag, $entity);
     $link_id = '#' . $link['#attributes']['id'];
 
     // Create a new JQuery Replace command to update the link display.
diff --git a/src/Plugin/ActionLink/AJAXactionLink.php b/src/Plugin/ActionLink/AJAXactionLink.php
index d77e0a2..08f9edc 100644
--- a/src/Plugin/ActionLink/AJAXactionLink.php
+++ b/src/Plugin/ActionLink/AJAXactionLink.php
@@ -38,8 +38,8 @@ class AJAXactionLink extends ActionLinkTypeBase {
   /**
    * {@inheritdoc}
    */
-  public function renderLink($action, FlagInterface $flag, EntityInterface $entity) {
-    $render = parent::renderLink($action, $flag, $entity);
+  public function renderLink(FlagInterface $flag, EntityInterface $entity) {
+    $render = parent::renderLink($flag, $entity);
     $render['#attached']['library'][] = 'core/drupal.ajax';
     $render['#attributes']['class'][] = 'use-ajax';
     return $render;
diff --git a/src/Plugin/views/field/FlagViewsLinkField.php b/src/Plugin/views/field/FlagViewsLinkField.php
index 45604c4..108ed93 100644
--- a/src/Plugin/views/field/FlagViewsLinkField.php
+++ b/src/Plugin/views/field/FlagViewsLinkField.php
@@ -106,13 +106,8 @@ class FlagViewsLinkField extends FieldPluginBase {
 
     $flag = $this->getFlag();
     $link_type_plugin = $flag->getLinkTypePlugin();
-    $action = 'flag';
 
-    if ($flag->isFlagged($entity)) {
-      $action = 'unflag';
-    }
-
-    $link = $link_type_plugin->renderLink($action, $flag, $entity);
+    $link = $link_type_plugin->renderLink($flag, $entity);
 
     return $link;
   }
