diff --git a/uc_catalog/src/Tests/CatalogTest.php b/uc_catalog/src/Tests/CatalogTest.php
index 26b1d49..72ff259 100644
--- a/uc_catalog/src/Tests/CatalogTest.php
+++ b/uc_catalog/src/Tests/CatalogTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\uc_catalog\Tests;
 
 use Drupal\Core\Language\Language;
+use Drupal\taxonomy\Entity\Term;
 use Drupal\uc_store\Tests\UbercartTestBase;
 
 /**
@@ -105,8 +106,8 @@ class CatalogTest extends UbercartTestBase {
   /**
    * Returns a new term with random properties in the catalog vocabulary.
    */
-  function createTerm() {
-    $term = entity_create('taxonomy_term', array(
+  protected function createTerm() {
+    $term = Term::create([
       'name' => $this->randomMachineName(),
       'description' => array(
         'value' => $this->randomMachineName(),
@@ -114,7 +115,7 @@ class CatalogTest extends UbercartTestBase {
       ),
       'vid' => 'catalog',
       'langcode' => Language::LANGCODE_NOT_SPECIFIED,
-    ));
+    ]);
     $term->save();
     return $term;
   }
diff --git a/uc_catalog/uc_catalog.module b/uc_catalog/uc_catalog.module
index 35f2f3f..495ce5a 100644
--- a/uc_catalog/uc_catalog.module
+++ b/uc_catalog/uc_catalog.module
@@ -282,7 +282,7 @@ function uc_catalog_add_node_type($type) {
   $vid = \Drupal::config('uc_catalog.settings')->get('vocabulary');
 
   if (!FieldStorageConfig::loadByName('node', 'taxonomy_catalog')) {
-    entity_create('field_storage_config', array(
+    FieldStorageConfig::create([
       'entity_type' => 'node',
       'field_name' => 'taxonomy_catalog',
       'type' => 'entity_reference',
@@ -290,11 +290,11 @@ function uc_catalog_add_node_type($type) {
         'target_type' => 'taxonomy_term',
       ),
       'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
-    ))->save();
+    ])->save();
   }
 
   if (!FieldConfig::loadByName('node', $type, 'taxonomy_catalog')) {
-    entity_create('field_config', array(
+    FieldConfig::create([
       'field_name' => 'taxonomy_catalog',
       'entity_type' => 'node',
       'bundle' => $type,
@@ -307,18 +307,18 @@ function uc_catalog_add_node_type($type) {
           'auto_create' => TRUE,
         ),
       ),
-    ))->save();
+    ])->save();
   }
 
   // Make sure catalog field shows up on node edit form.
-  $form = entity_get_form_display('node', $type, 'default')
+  entity_get_form_display('node', $type, 'default')
     ->setComponent('taxonomy_catalog', array(
       'type' => 'options_select',
     ))
     ->save();
 
   // Display catalog value on node view.
-  $display = entity_get_display('node', $type, 'default')
+  entity_get_display('node', $type, 'default')
     ->setComponent('taxonomy_catalog', array(
       'type' => 'entity_reference_label',
     ))
@@ -330,21 +330,21 @@ function uc_catalog_add_node_type($type) {
  */
 function uc_catalog_add_image_field() {
   if (!FieldStorageConfig::loadByName('taxonomy_term', 'uc_catalog_image')) {
-    entity_create('field_storage_config', array(
+    FieldStorageConfig::create([
       'entity_type' => 'taxonomy_term',
       'field_name' => 'uc_catalog_image',
       'type' => 'image',
-    ))->save();
+    ])->save();
   }
 
   // Only add the instance if it doesn't exist. Don't overwrite any changes.
   if (!FieldConfig::loadByName('taxonomy_term', 'catalog', 'uc_catalog_image')) {
-    entity_create('field_config', array(
+    FieldConfig::create([
       'field_name' => 'uc_catalog_image',
       'entity_type' => 'taxonomy_term',
       'bundle' => 'catalog',
       'label' => t('Image'),
-    ))->save();
+    ])->save();
 
     entity_get_form_display('taxonomy_term', 'catalog', 'default')
       ->setComponent('uc_catalog_image', array(
diff --git a/uc_product/uc_product.module b/uc_product/uc_product.module
index 025f971..e3eb695 100644
--- a/uc_product/uc_product.module
+++ b/uc_product/uc_product.module
@@ -983,11 +983,9 @@ function uc_product_node_type_update(NodeTypeInterface $type) {
  *   types get an instance of the field.
  */
 function uc_product_add_default_image_field($type = NULL) {
-  $field = FieldStorageConfig::loadByName('node', 'uc_product_image');
-
   // Set up field if it doesn't exist.
-  if (!$field) {
-    $field = entity_create('field_storage_config', array(
+  if (!FieldStorageConfig::loadByName('node', 'uc_product_image')) {
+    FieldStorageConfig::create([
       'entity_type' => 'node',
       'field_name' => 'uc_product_image',
       'type' => 'image',
@@ -995,8 +993,7 @@ function uc_product_add_default_image_field($type = NULL) {
       'settings' => array(
         'display_field' => 0,
       ),
-    ));
-    $field->save();
+    ])->save();
   }
 
   if ($type) {
@@ -1011,13 +1008,13 @@ function uc_product_add_default_image_field($type = NULL) {
 
     // Only add the instance if it doesn't exist. Don't overwrite any changes.
     if ($field_name && !FieldConfig::loadByName('node', $type, $field_name)) {
-      entity_create('field_config', array(
+      FieldConfig::create([
         'entity_type' => 'node',
         'bundle' => $type,
         'field_name' => $field_name,
         'label' => t('Image'),
         'weight' => -2,
-      ))->save();
+      ])->save();
 
       NodeType::load($type)
         ->setThirdPartySetting('uc_product', 'image_field', $field_name)
