diff --git a/modules/widget_engine_entity_form/src/Controller/WidgetEntityBrowserController.php b/modules/widget_engine_entity_form/src/Controller/WidgetEntityBrowserController.php
index 62e8549b2a70c07f05aa7364ac2495d74a54fb86..8ad74516b6a01eedfcdb2cfe8a6cff8a1dd579a9 100644
--- a/modules/widget_engine_entity_form/src/Controller/WidgetEntityBrowserController.php
+++ b/modules/widget_engine_entity_form/src/Controller/WidgetEntityBrowserController.php
@@ -92,7 +92,7 @@ class WidgetEntityBrowserController extends ControllerBase {
           'resizable' => 0,
         ];
       }
-      $response = AjaxResponse::create()->addCommand(new OpenDialogCommand('#' . $entity->getEntityTypeId() . '-' . $entity->id() . '-edit-dialog', $title, $form, $options));
+      $response = (new AjaxResponse())->addCommand(new OpenDialogCommand('#' . $entity->getEntityTypeId() . '-' . $entity->id() . '-edit-dialog', $title, $form, $options));
       if ($form_state->getErrors()) {
         $response->addCommand(
           new PrependCommand('#' . $entity->getEntityTypeId() . '-' . $entity->id() . '-edit-dialog', StatusMessages::renderMessages('error'))
@@ -102,7 +102,7 @@ class WidgetEntityBrowserController extends ControllerBase {
     }
     else {
       // Return command for closing the modal.
-      $response = AjaxResponse::create()->addCommand(new CloseDialogCommand('#' . $entity->getEntityTypeId() . '-' . $entity->id() . '-edit-dialog'));
+      $response = (new AjaxResponse())->addCommand(new CloseDialogCommand('#' . $entity->getEntityTypeId() . '-' . $entity->id() . '-edit-dialog'));
       // Also refresh the widget if "details_id" is provided.
       $details_id = $request->query->get('details_id');
       if (!empty($details_id)) {