diff --git a/flexfield.info.yml b/flexfield.info.yml
index da8ab6c..1477667 100755
--- a/flexfield.info.yml
+++ b/flexfield.info.yml
@@ -2,6 +2,7 @@ name: Flex Field
 type: module
 description: Create simple, but flexible, multivalue fields without the hassle of entity references.
 core: 8.x
+core_version_requirement: ^8 || ^9
 package: Field
 dependencies:
   - field
diff --git a/src/Plugin/Field/FieldFormatter/FlexTemplateFormatter.php b/src/Plugin/Field/FieldFormatter/FlexTemplateFormatter.php
index 1eae6cd..168d661 100755
--- a/src/Plugin/Field/FieldFormatter/FlexTemplateFormatter.php
+++ b/src/Plugin/Field/FieldFormatter/FlexTemplateFormatter.php
@@ -58,7 +58,7 @@ class FlexTemplateFormatter extends FlexFormatterBase {
     $form['template'] = [
       '#type' => 'textarea',
       '#ttile' => t('Template'),
-      '#description' => t('Output flexfield items using a custom template. Newlines will be converted to <br>. The following tokens are available for replacement: <br>') . drupal_render($tokens),
+      '#description' => t('Output flexfield items using a custom template. Newlines will be converted to <br>. The following tokens are available for replacement: <br>') . \Drupal::service('renderer')->render($tokens),
       '#rows' => 2,
       '#default_value' => $this->getSetting('template'),
     ];
diff --git a/src/Plugin/Field/FieldType/FlexItem.php b/src/Plugin/Field/FieldType/FlexItem.php
index 4f2e5f4..0cf05a3 100755
--- a/src/Plugin/Field/FieldType/FlexItem.php
+++ b/src/Plugin/Field/FieldType/FlexItem.php
@@ -371,7 +371,7 @@ class FlexItem extends FieldItemBase {
   protected function getExistingFlexFieldStorageOptions($entity_type_id) {
     $sources = ['' => []];
     $existing_flexfields = \Drupal::service('entity_field.manager')->getFieldMapByFieldType('flex');
-    $bundle_info = \Drupal::entityManager()->getBundleInfo($entity_type_id);
+    $bundle_info = \Drupal::service('entity_type.bundle.info')->getBundleInfo($entity_type_id);
     foreach ($existing_flexfields[$entity_type_id] as $field_name => $info) {
       // Skip ourself
       if ($this->getFieldDefinition()->getName() != $field_name) {
