diff --git a/config/install/scheduler.settings.yml b/config/install/scheduler.settings.yml
index 4dcfcd9..c1746fa 100644
--- a/config/install/scheduler.settings.yml
+++ b/config/install/scheduler.settings.yml
@@ -1,7 +1,19 @@
 allow_date_only: false
 date_format: 'Y-m-d H:i:s'
+date_letters: 'djmnFMyY'
 date_only_format: 'Y-m-d'
+default_expand_fieldset: 'when_required'
+default_fields_display_mode: 'vertical_tab'
+default_publish_enable: false
+default_publish_past_date: 'error'
+default_publish_required: false
+default_publish_revision: false
+default_publish_touch: false
+default_unpublish_enable: false
+default_unpublish_required: false
+default_unpublish_revision: false
 default_time: '00:00:00'
 lightweight_cron_access_key: ''
 log: true
 time_only_format: 'H:i:s'
+time_letters: 'hHgGisaA'
diff --git a/scheduler.admin.inc b/scheduler.admin.inc
index 29cbf40..85284c3 100644
--- a/scheduler.admin.inc
+++ b/scheduler.admin.inc
@@ -14,6 +14,8 @@ use Drupal\node\NodeTypeInterface;
  * @see scheduler_form_node_type_form_alter()
  */
 function _scheduler_form_node_type_form_alter(array &$form, FormStateInterface $form_state) {
+  $config = \Drupal::config('scheduler.settings');
+
   /** @var \Drupal\node\NodeTypeInterface $type */
   $type = $form_state->getFormObject()->getEntity();
 
@@ -38,12 +40,12 @@ function _scheduler_form_node_type_form_alter(array &$form, FormStateInterface $
   $form['scheduler']['publish']['scheduler_publish_enable'] = array(
     '#type' => 'checkbox',
     '#title' => t('Enable scheduled publishing for this content type'),
-    '#default_value' => $type->getThirdPartySetting('scheduler', 'publish_enable', SCHEDULER_DEFAULT_PUBLISH_ENABLE),
+    '#default_value' => $type->getThirdPartySetting('scheduler', 'publish_enable', $config->get('default_publish_enable')),
   );
   $form['scheduler']['publish']['scheduler_publish_touch'] = array(
     '#type' => 'checkbox',
     '#title' => t('Change content creation time to match the scheduled publish time'),
-    '#default_value' => $type->getThirdPartySetting('scheduler', 'publish_touch', SCHEDULER_DEFAULT_PUBLISH_TOUCH),
+    '#default_value' => $type->getThirdPartySetting('scheduler', 'publish_touch', $config->get('default_publish_touch')),
     '#states' => array(
       'visible' => array(
         ':input[name="scheduler_publish_enable"]' => array('checked' => TRUE),
@@ -53,7 +55,7 @@ function _scheduler_form_node_type_form_alter(array &$form, FormStateInterface $
   $form['scheduler']['publish']['scheduler_publish_required'] = array(
     '#type' => 'checkbox',
     '#title' => t('Require scheduled publishing'),
-    '#default_value' => $type->getThirdPartySetting('scheduler', 'publish_required', SCHEDULER_DEFAULT_PUBLISH_REQUIRED),
+    '#default_value' => $type->getThirdPartySetting('scheduler', 'publish_required', $config->get('default_publish_require')),
     '#states' => array(
       'visible' => array(
         ':input[name="scheduler_publish_enable"]' => array('checked' => TRUE),
@@ -63,7 +65,7 @@ function _scheduler_form_node_type_form_alter(array &$form, FormStateInterface $
   $form['scheduler']['publish']['scheduler_publish_revision'] = array(
     '#type' => 'checkbox',
     '#title' => t('Create a new revision on publishing'),
-    '#default_value' => $type->getThirdPartySetting('scheduler', 'publish_revision', SCHEDULER_DEFAULT_PUBLISH_REVISION),
+    '#default_value' => $type->getThirdPartySetting('scheduler', 'publish_revision', $config->get('default_publish_revision')),
     '#states' => array(
       'visible' => array(
         ':input[name="scheduler_publish_enable"]' => array('checked' => TRUE),
@@ -83,7 +85,7 @@ function _scheduler_form_node_type_form_alter(array &$form, FormStateInterface $
   $form['scheduler']['publish']['advanced']['scheduler_publish_past_date'] = array(
     '#type' => 'radios',
     '#title' => t('Action to be taken for publication dates in the past'),
-    '#default_value' => $type->getThirdPartySetting('scheduler', 'publish_past_date', SCHEDULER_DEFAULT_PUBLISH_PAST_DATE),
+    '#default_value' => $type->getThirdPartySetting('scheduler', 'publish_past_date', $config->get('default_publish_past_date')),
     '#options' => array(
       'error' => t('Display an error message - do not allow dates in the past'),
       'publish' => t('Publish the content immediately after saving'),
@@ -102,12 +104,12 @@ function _scheduler_form_node_type_form_alter(array &$form, FormStateInterface $
   $form['scheduler']['unpublish']['scheduler_unpublish_enable'] = array(
     '#type' => 'checkbox',
     '#title' => t('Enable scheduled unpublishing for this content type'),
-    '#default_value' => $type->getThirdPartySetting('scheduler', 'unpublish_enable', SCHEDULER_DEFAULT_UNPUBLISH_ENABLE),
+    '#default_value' => $type->getThirdPartySetting('scheduler', 'unpublish_enable', $config->get('default_unpublish_enable')),
   );
   $form['scheduler']['unpublish']['scheduler_unpublish_required'] = array(
     '#type' => 'checkbox',
     '#title' => t('Require scheduled unpublishing'),
-    '#default_value' => $type->getThirdPartySetting('scheduler', 'unpublish_required', SCHEDULER_DEFAULT_UNPUBLISH_REQUIRED),
+    '#default_value' => $type->getThirdPartySetting('scheduler', 'unpublish_required', $config->get('default_unpublish_required')),
     '#states' => array(
       'visible' => array(
         ':input[name="scheduler_unpublish_enable"]' => array('checked' => TRUE),
@@ -117,7 +119,7 @@ function _scheduler_form_node_type_form_alter(array &$form, FormStateInterface $
   $form['scheduler']['unpublish']['scheduler_unpublish_revision'] = array(
     '#type' => 'checkbox',
     '#title' => t('Create a new revision on unpublishing'),
-    '#default_value' => $type->getThirdPartySetting('scheduler', 'unpublish_revision', SCHEDULER_DEFAULT_UNPUBLISH_REVISION),
+    '#default_value' => $type->getThirdPartySetting('scheduler', 'unpublish_revision', $config->get('default_unpublish_revision')),
     '#states' => array(
       'visible' => array(
         ':input[name="scheduler_unpublish_enable"]' => array('checked' => TRUE),
@@ -146,7 +148,7 @@ function _scheduler_form_node_type_form_alter(array &$form, FormStateInterface $
   $form['scheduler']['node_edit_layout']['scheduler_fields_display_mode'] = array(
     '#type' => 'radios',
     '#title' => t('Display scheduling options as'),
-    '#default_value' => $type->getThirdPartySetting('scheduler', 'fields_display_mode', SCHEDULER_DEFAULT_FIELDS_DISPLAY_MODE),
+    '#default_value' => $type->getThirdPartySetting('scheduler', 'fields_display_mode', $config->get('default_fields_display_mode')),
     '#options' => array(
       'vertical_tab' => t('Vertical tab'),
       'fieldset' => t('Separate fieldset'),
@@ -156,7 +158,7 @@ function _scheduler_form_node_type_form_alter(array &$form, FormStateInterface $
   $form['scheduler']['node_edit_layout']['scheduler_expand_fieldset'] = array(
     '#type' => 'radios',
     '#title' => t('Expand fieldset or vertical tab'),
-    '#default_value' => $type->getThirdPartySetting('scheduler', 'expand_fieldset', SCHEDULER_DEFAULT_EXPAND_FIELDSET),
+    '#default_value' => $type->getThirdPartySetting('scheduler', 'expand_fieldset', $config->get('default_expand_fieldset')),
     '#options' => array(
       'when_required' => t('Expand only when a scheduled date exists or when a date is required'),
       'always' => t('Always open the fieldset or vertical tab'),
diff --git a/scheduler.module b/scheduler.module
index f64d3a8..b01f457 100644
--- a/scheduler.module
+++ b/scheduler.module
@@ -15,38 +15,6 @@ use Drupal\Core\Url;
 use Drupal\node\NodeInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 
-// @todo Move constants into a class, so we do not pollute the global space,
-// and use them like this, for example: SchedulerApi::MY_CONSTANT.
-// @see https://www.drupal.org/node/2682579
-
-// The default format to use if no custom format has been configured.
-define('SCHEDULER_DATE_FORMAT', 'Y-m-d H:i:s');
-
-// The default date and time formats to use when only a date has been entered.
-// These should match the date and time parts of SCHEDULER_DATE_FORMAT above.
-define('SCHEDULER_DATE_ONLY_FORMAT', 'Y-m-d');
-define('SCHEDULER_TIME_ONLY_FORMAT', 'H:i:s');
-
-// The default time that will be used, until Admin sets a different value.
-define('SCHEDULER_DEFAULT_TIME', '00:00:00');
-
-// The full set of date and time letters allowed in the scheduler date format.
-define('SCHEDULER_DATE_LETTERS', 'djmnFMyY');
-define('SCHEDULER_TIME_LETTERS', 'hHgGisaA');
-
-// Specify defaults for the per-content-type settings. These should be used as
-// a consistent third parameter for calls to getThirdPartySetting().
-define('SCHEDULER_DEFAULT_EXPAND_FIELDSET', 'when_required');
-define('SCHEDULER_DEFAULT_FIELDS_DISPLAY_MODE', 'vertical_tab');
-define('SCHEDULER_DEFAULT_PUBLISH_ENABLE', FALSE);
-define('SCHEDULER_DEFAULT_PUBLISH_PAST_DATE', 'error');
-define('SCHEDULER_DEFAULT_PUBLISH_REQUIRED', FALSE);
-define('SCHEDULER_DEFAULT_PUBLISH_REVISION', FALSE);
-define('SCHEDULER_DEFAULT_PUBLISH_TOUCH', FALSE);
-define('SCHEDULER_DEFAULT_UNPUBLISH_ENABLE', FALSE);
-define('SCHEDULER_DEFAULT_UNPUBLISH_REQUIRED', FALSE);
-define('SCHEDULER_DEFAULT_UNPUBLISH_REVISION', FALSE);
-
 /**
  * Implements hook_help().
  */
@@ -90,30 +58,31 @@ function scheduler_form_node_type_form_alter(array &$form, FormStateInterface $f
  * Implements hook_form_BASE_FORM_ID_alter() for node_form.
  */
 function scheduler_form_node_form_alter(&$form, FormStateInterface $form_state) {
+  $config = \Drupal::config('scheduler.settings');
   $date_formatter = \Drupal::service('date.formatter');
   /** @var \Drupal\node\NodeTypeInterface $type */
   $type = $form_state->getFormObject()->getEntity()->type->entity;
-  $publishing_enabled = $type->getThirdPartySetting('scheduler', 'publish_enable', SCHEDULER_DEFAULT_PUBLISH_ENABLE);
-  $unpublishing_enabled = $type->getThirdPartySetting('scheduler', 'unpublish_enable', SCHEDULER_DEFAULT_UNPUBLISH_ENABLE);
-  $use_vertical_tabs = $type->getThirdPartySetting('scheduler', 'fields_display_mode', SCHEDULER_DEFAULT_FIELDS_DISPLAY_MODE) === 'vertical_tab';
+  $publishing_enabled = $type->getThirdPartySetting('scheduler', 'publish_enable', $config->get('default_publish_enable'));
+  $unpublishing_enabled = $type->getThirdPartySetting('scheduler', 'unpublish_enable', $config->get('default_unpublish_enable'));
+  $use_vertical_tabs = $type->getThirdPartySetting('scheduler', 'fields_display_mode', $config->get('default_fields_display_mode')) === 'vertical_tab';
 
-  $date_format = \Drupal::config('scheduler.settings')->get('date_format');
-  $date_only_format = \Drupal::config('scheduler.settings')->get('date_only_format');
-  $time_only_format = \Drupal::config('scheduler.settings')->get('time_only_format');
-  $date_only_allowed = \Drupal::config('scheduler.settings')->get('allow_date_only');
+  $date_format = $config->get('date_format');
+  $date_only_format = $config->get('date_only_format');
+  $time_only_format = $config->get('time_only_format');
+  $date_only_allowed = $config->get('allow_date_only');
 
   /* @var $node \Drupal\node\NodeInterface */
   $node = $form_state->getFormObject()->getEntity();
 
   // A publish_on date is required if the content type option is set and the
   // node is being created or it currently has a scheduled publishing date.
-  $publishing_required = $type->getThirdPartySetting('scheduler', 'publish_required', SCHEDULER_DEFAULT_PUBLISH_REQUIRED)
+  $publishing_required = $type->getThirdPartySetting('scheduler', 'publish_required', $config->get('default_publish_required'))
     && ($node->isNew() || (!$node->isPublished() && !empty($node->publish_on->value)));
 
   // An unpublish_on date is required if the content type option is set and the
   // node is being created or the current status is published or the node is
   // scheduled to be published.
-  $unpublishing_required = $type->getThirdPartySetting('scheduler', 'unpublish_required', SCHEDULER_DEFAULT_UNPUBLISH_REQUIRED) && ($node->isNew() || $node->isPublished() || !empty($node->publish_on->value));
+  $unpublishing_required = $type->getThirdPartySetting('scheduler', 'unpublish_required', $config->get('default_unpublish_required')) && ($node->isNew() || $node->isPublished() || !empty($node->publish_on->value));
 
   // If either publishing or unpublishing is enabled, provide a field group to
   // wrap the scheduling fields.
@@ -121,7 +90,7 @@ function scheduler_form_node_form_alter(&$form, FormStateInterface $form_state)
     // Expand the fieldset if publishing or unpublishing is required, if a date
     // already exists or the fieldset is configured to be always expanded.
     $has_data = !empty($node->publish_on->value) || !empty($node->unpublish_on->value);
-    $always_expand = $type->getThirdPartySetting('scheduler', 'expand_fieldset', SCHEDULER_DEFAULT_EXPAND_FIELDSET) === 'always';
+    $always_expand = $type->getThirdPartySetting('scheduler', 'expand_fieldset', \Drupal::config('scheduler.settings')->get('default_expand_fieldset')) === 'always';
     $expand_details = $publishing_required || $unpublishing_required || $has_data || $always_expand;
 
     // Create the group for the fields.
@@ -168,7 +137,7 @@ function scheduler_form_node_form_alter(&$form, FormStateInterface $form_state)
   if ($date_only_allowed) {
     $default_time = strtotime(\Drupal::config('scheduler.settings')->get('default_time'));
     $descriptions['default'] = t('The default time is @default_time.', array(
-      '@default_time' => $date_formatter->format($default_time, 'custom', $time_only_format ? $time_only_format : SCHEDULER_TIME_ONLY_FORMAT),
+      '@default_time' => $date_formatter->format($default_time, 'custom', $time_only_format),
     ));
   }
 
@@ -290,9 +259,11 @@ function scheduler_node_validate($node, array $form, FormStateInterface $form_st
  * Implements hook_ENTITY_TYPE_presave() for node entities.
  */
 function scheduler_node_presave(EntityInterface $node) {
+  $config = \Drupal::config('scheduler.settings');
   $entity = $node->type->entity;
+
   // If the node type is not enabled for Scheduler then do nothing.
-  if (!$entity->getThirdPartySetting('scheduler', 'publish_enable', SCHEDULER_DEFAULT_PUBLISH_ENABLE)) {
+  if (!$entity->getThirdPartySetting('scheduler', 'publish_enable', $config->get('default_publish_enable'))) {
     return;
   };
 
@@ -301,11 +272,11 @@ function scheduler_node_presave(EntityInterface $node) {
     $publication_allowed = \Drupal::service('scheduler.manager')->isAllowed($node, 'publish');
 
     // Publish the node immediately if the publication date is in the past.
-    $publish_immediately = $entity->getThirdPartySetting('scheduler', 'publish_past_date', SCHEDULER_DEFAULT_PUBLISH_PAST_DATE) == 'publish';
+    $publish_immediately = $entity->getThirdPartySetting('scheduler', 'publish_past_date', $config->get('default_publish_past_date')) == 'publish';
 
     if ($publication_allowed && $publish_immediately && $node->publish_on->value <= REQUEST_TIME) {
       // If required, set the created date to match published date.
-      if ($entity->getThirdPartySetting('scheduler', 'publish_touch', SCHEDULER_DEFAULT_PUBLISH_TOUCH)) {
+      if ($entity->getThirdPartySetting('scheduler', 'publish_touch', $config->get('default_publish_touch'))) {
         $node->setCreatedTime($node->publish_on->value);
       }
       $node->publish_on->value = NULL;
@@ -434,13 +405,15 @@ function _scheduler_scheduler_api(NodeInterface $node, $action) {
  * Implements hook_entity_extra_field_info().
  */
 function scheduler_entity_extra_field_info() {
+  $config = \Drupal::config('scheduler.settings');
+
   // Expose the Scheduler group on the 'Manage Form Display' tab when editing a
   // content type. This allows admins to adjust the weight of the group, and it
   // works for vertical tabs and separate fieldsets.
   $fields = array();
   foreach (node_type_get_types() as $type) {
-    $publishing_enabled = $type->getThirdPartySetting('scheduler', 'publish_enable', SCHEDULER_DEFAULT_PUBLISH_ENABLE);
-    $unpublishing_enabled = $type->getThirdPartySetting('scheduler', 'unpublish_enable', SCHEDULER_DEFAULT_UNPUBLISH_ENABLE);
+    $publishing_enabled = $type->getThirdPartySetting('scheduler', 'publish_enable', $config->get('default_publish_enable'));
+    $unpublishing_enabled = $type->getThirdPartySetting('scheduler', 'unpublish_enable', $config->get('default_unpublish_enable'));
 
     if ($publishing_enabled || $unpublishing_enabled) {
       $fields['node'][$type->get('type')]['form']['scheduler_settings'] = array(
@@ -484,10 +457,12 @@ function scheduler_preprocess_node(&$variables) {
  * @see https://www.drupal.org/node/2651354
  */
 function scheduler_feeds_processor_targets_alter(&$targets, $entity_type, $bundle_name) {
+  $config = \Drupal::config('scheduler.settings');
+
   // Scheduler module only works on nodes.
   if ($entity_type == 'node') {
-    $publishing_enabled = $entity_type->getThirdPartySetting('scheduler', 'publish_enable', SCHEDULER_DEFAULT_PUBLISH_ENABLE);
-    $unpublishing_enabled = $entity_type->getThirdPartySetting('scheduler', 'unpublish_enable', SCHEDULER_DEFAULT_UNPUBLISH_ENABLE);
+    $publishing_enabled = $entity_type->getThirdPartySetting('scheduler', 'publish_enable', $config->get('default_publish_enable'));
+    $unpublishing_enabled = $entity_type->getThirdPartySetting('scheduler', 'unpublish_enable', $config->get('default_unpublish_enable'));
 
     if ($publishing_enabled) {
       $targets['publish_on'] = array(
diff --git a/scheduler.rules.inc b/scheduler.rules.inc
index 883e0fd..617c08a 100644
--- a/scheduler.rules.inc
+++ b/scheduler.rules.inc
@@ -131,7 +131,7 @@ function scheduler_set_publish_date_action(Node $node, $date) {
   // hook_node_presave() and hook_node_update() will be executed anyway. But if
   // this action is being used to schedule a different node then we need to call
   // the functions directly here.
-  if ($node->type->entity->getThirdPartySetting('scheduler', 'publish_enable', SCHEDULER_DEFAULT_PUBLISH_ENABLE)) {
+  if ($node->type->entity->getThirdPartySetting('scheduler', 'publish_enable', \Drupal::config('scheduler.settings')->get('default_publish_enable'))) {
     $node->publish_on->value = $date;
     scheduler_node_presave($node);
     scheduler_node_update($node);
@@ -152,7 +152,8 @@ function scheduler_set_publish_date_action(Node $node, $date) {
  *   The date for unpublishing, a unix timestamp integer.
  */
 function scheduler_set_unpublish_date_action(Node $node, $date) {
-  if ($node->type->entity->getThirdPartySetting('scheduler', 'unpublish_enable', SCHEDULER_DEFAULT_UNPUBLISH_ENABLE)) {
+  $default_unpublish_enable = \Drupal::config('scheduler.settings')->get('default_unpublish_enable');
+  if ($node->type->entity->getThirdPartySetting('scheduler', 'unpublish_enable', $default_unpublish_enable)) {
     $node->unpublish_on->value = $date;
     scheduler_node_presave($node);
     scheduler_node_update($node);
@@ -173,7 +174,7 @@ function scheduler_set_unpublish_date_action(Node $node, $date) {
  *   The node object from which to remove the publish_on date.
  */
 function scheduler_remove_publish_date_action(Node $node) {
-  if ($node->type->entity->getThirdPartySetting('scheduler', 'publish_enable', SCHEDULER_DEFAULT_PUBLISH_ENABLE)) {
+  if ($node->type->entity->getThirdPartySetting('scheduler', 'publish_enable', \Drupal::config('scheduler.settings')->get('default_publish_enable'))) {
     $node->publish_on->value = NULL;
     scheduler_node_presave($node);
     scheduler_node_update($node);
@@ -194,7 +195,8 @@ function scheduler_remove_publish_date_action(Node $node) {
  *   The node object from which to remove the unpublish_on date.
  */
 function scheduler_remove_unpublish_date_action(Node $node) {
-  if ($node->type->entity->getThirdPartySetting('scheduler', 'unpublish_enable', SCHEDULER_DEFAULT_UNPUBLISH_ENABLE)) {
+  $default_unpublish_enable = \Drupal::config('scheduler.settings')->get('default_unpublish_enable');
+  if ($node->type->entity->getThirdPartySetting('scheduler', 'unpublish_enable', $default_unpublish_enable)) {
     $node->unpublish_on->value = NULL;
     scheduler_node_presave($node);
     scheduler_node_update($node);
@@ -252,7 +254,7 @@ function scheduler_rules_condition_info() {
  *   TRUE if scheduled publishing is enabled for the node type, FALSE if not.
  */
 function scheduler_condition_publishing_is_enabled(Node $node) {
-  return ($node->type->entity->getThirdPartySetting('scheduler', 'publish_enable', SCHEDULER_DEFAULT_PUBLISH_ENABLE));
+  return ($node->type->entity->getThirdPartySetting('scheduler', 'publish_enable', \Drupal::config('scheduler.settings')->get('default_publish_enable')));
 }
 
 /**
@@ -264,7 +266,8 @@ function scheduler_condition_publishing_is_enabled(Node $node) {
  *   TRUE if scheduled unpublishing is enabled for the node type, FALSE if not.
  */
 function scheduler_condition_unpublishing_is_enabled(Node $node) {
-  return ($node->type->entity->getThirdPartySetting('scheduler', 'unpublish_enable', SCHEDULER_DEFAULT_UNPUBLISH_ENABLE));
+  $default_unpublish_enable = \Drupal::config('scheduler.settings')->get('default_unpublish_enable');
+  return ($node->type->entity->getThirdPartySetting('scheduler', 'unpublish_enable', $default_unpublish_enable));
 }
 
 /**
diff --git a/src/Form/SchedulerAdminForm.php b/src/Form/SchedulerAdminForm.php
index 6939fe3..bf406b7 100644
--- a/src/Form/SchedulerAdminForm.php
+++ b/src/Form/SchedulerAdminForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\scheduler\Form;
 
+use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Datetime\DateFormatterInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Drupal\Core\Form\FormStateInterface;
@@ -26,20 +27,33 @@ class SchedulerAdminForm extends ConfigFormBase {
   protected $dateFormatter;
 
   /**
+   * The configuration factory.
+   *
+   * @var \Drupal\Core\Config\ConfigFactoryInterface
+   */
+  protected $configFactory;
+  
+  /**
    * Creates instance of SchedulerAdminForm.
    *
    * @param \Drupal\Core\Datetime\DateFormatterInterface $date_formatter
    *   The date formatter service.
    */
-  public function __construct(DateFormatterInterface $date_formatter) {
+  public function __construct(DateFormatterInterface $date_formatter, ConfigFactoryInterface $config_factory) {
+    parent::__construct($config_factory);
+    
     $this->dateFormatter = $date_formatter;
+    $this->configFactory = $config_factory;
   }
 
   /**
    * {@inheritdoc}
    */
   public static function create(ContainerInterface $container) {
-    return new static($container->get('date.formatter'));
+    return new static(
+      $container->get('date.formatter'),
+      $container->get('config.factory')
+    );
   }
 
   /**
@@ -60,20 +74,20 @@ class SchedulerAdminForm extends ConfigFormBase {
    * {@inheritdoc}
    */
   public function buildForm(array $form, FormStateInterface $form_state) {
-    $config = $this->config('scheduler.settings');
-    $now = $this->t('Example: %date', ['%date' => $this->dateFormatter->format(REQUEST_TIME, 'custom', $config->get('date_format'))]);
+    $date_format = $this->setting('date_format');
+    $now = $this->t('Example: %date', ['%date' => $this->dateFormatter->format(REQUEST_TIME, 'custom', $date_format)]);
     $url = Url::fromUri('http://php.net/manual/en/function.date.php');
     $form['date_format'] = [
       '#type' => 'textfield',
       '#title' => $this->t('Date format'),
-      '#default_value' => $config->get('date_format'),
+      '#default_value' => $date_format,
       '#size' => 20,
       '#maxlength' => 20,
       '#required' => TRUE,
       '#field_suffix' => ' <small>' . $now . '</small>',
       '#description' => $this->t('The format for entering scheduled dates and times. For the date use the letters %date_letters and for the time use %time_letters. See @url for more details.', [
-        '%date_letters' => SCHEDULER_DATE_LETTERS,
-        '%time_letters' => SCHEDULER_TIME_LETTERS,
+        '%date_letters' => $this->setting('date_letters'),
+        '%time_letters' => $this->setting('time_letters'),
         '@url' => \Drupal::l($this->t('the PHP date() function'), $url),
       ]),
     ];
@@ -87,13 +101,13 @@ class SchedulerAdminForm extends ConfigFormBase {
     $form['date_only_fieldset']['allow_date_only'] = [
       '#type' => 'checkbox',
       '#title' => $this->t('Allow users to enter only a date and provide a default time.'),
-      '#default_value' => $config->get('allow_date_only'),
+      '#default_value' => $this->setting('allow_date_only'),
       '#description' => $this->t('When only a date is entered the time will default to a specified value, but the user can change this if required.'),
     ];
     $form['date_only_fieldset']['default_time'] = [
       '#type' => 'textfield',
       '#title' => $this->t('Default time'),
-      '#default_value' => $config->get('default_time'),
+      '#default_value' => $this->setting('default_time'),
       '#size' => 20,
       '#maxlength' => 20,
       '#description' => $this->t('This is the time that will be used if the user does not enter a value. Format: HH:MM:SS.'),
@@ -120,10 +134,10 @@ class SchedulerAdminForm extends ConfigFormBase {
     // there is nothing else which is not in the list of acceptable date/time
     // letters.
     $no_punctuation = preg_replace('/[^\w+]/', '', $form_state->getValue(['date_format']));
-    if (preg_match_all('/[^' . SCHEDULER_DATE_LETTERS . SCHEDULER_TIME_LETTERS . ']/', $no_punctuation, $extra)) {
+    if (preg_match_all('/[^' . $this->setting('date_letters') . $this->setting('time_letters') . ']/', $no_punctuation, $extra)) {
       $form_state->setErrorByName('date_format', $this->t('You may only use the letters $date_letters for the date and $time_letters for the time. Remove the extra characters $extra', [
-        '$date_letters' => SCHEDULER_DATE_LETTERS,
-        '$time_letters' => SCHEDULER_TIME_LETTERS,
+        '$date_letters' => $this->setting('date_letters'),
+        '$time_letters' => $this->setting('time_letters'),
         '$extra' => implode(' ', $extra[0]),
       ]));
     };
@@ -192,8 +206,8 @@ class SchedulerAdminForm extends ConfigFormBase {
    *   contain a time part.
    */
   protected function getTimeOnlyFormat($format) {
-    $time_start = strcspn($format, SCHEDULER_TIME_LETTERS);
-    $time_length = strlen($format) - strcspn(strrev($format), SCHEDULER_TIME_LETTERS) - $time_start;
+    $time_start = strcspn($format, $this->setting('time_letters'));
+    $time_length = strlen($format) - strcspn(strrev($format), $this->setting('time_letters')) - $time_start;
     return substr($format, $time_start, $time_length);
   }
 
@@ -210,9 +224,21 @@ class SchedulerAdminForm extends ConfigFormBase {
    *   contain a date part.
    */
   protected function getDateOnlyFormat($format) {
-    $date_start = strcspn($format, SCHEDULER_DATE_LETTERS);
-    $date_length = strlen($format) - strcspn(strrev($format), SCHEDULER_DATE_LETTERS) - $date_start;
+    $date_start = strcspn($format, $this->setting('date_letters'));
+    $date_length = strlen($format) - strcspn(strrev($format), $this->setting('date_letters')) - $date_start;
     return substr($format, $date_start, $date_length);
   }
 
+  /**
+   * Helper method to access the settings of this module.
+   *
+   * @param string $key
+   *   The key of the configuration.
+   *
+   * @return \Drupal\Core\Config\ImmutableConfig
+   */
+  protected function setting($key) {
+    return $this->configFactory->get('scheduler.settings')->get($key);
+  }
+
 }
diff --git a/src/Plugin/Validation/Constraint/SchedulerPublishOnConstraintValidator.php b/src/Plugin/Validation/Constraint/SchedulerPublishOnConstraintValidator.php
index b0512bc..2d84961 100644
--- a/src/Plugin/Validation/Constraint/SchedulerPublishOnConstraintValidator.php
+++ b/src/Plugin/Validation/Constraint/SchedulerPublishOnConstraintValidator.php
@@ -20,7 +20,8 @@ class SchedulerPublishOnConstraintValidator extends ConstraintValidator {
    */
   public function validate($entity, Constraint $constraint) {
     $publish_on = $entity->value;
-    $scheduler_publish_past_date = $entity->getEntity()->type->entity->getThirdPartySetting('scheduler', 'publish_past_date', SCHEDULER_DEFAULT_PUBLISH_PAST_DATE);
+    $default_publish_past_date = \Drupal::config('scheduler.settings')->get('default_publish_past_date');
+    $scheduler_publish_past_date = $entity->getEntity()->type->entity->getThirdPartySetting('scheduler', 'publish_past_date', $default_publish_past_date);
 
     if ($publish_on && $scheduler_publish_past_date == 'error' && $publish_on < REQUEST_TIME) {
       $this->context->buildViolation($constraint->messagePublishOnDateNotInFuture)
diff --git a/src/Plugin/Validation/Constraint/SchedulerUnpublishOnConstraintValidator.php b/src/Plugin/Validation/Constraint/SchedulerUnpublishOnConstraintValidator.php
index 2ad4c3d..3eda3cd 100644
--- a/src/Plugin/Validation/Constraint/SchedulerUnpublishOnConstraintValidator.php
+++ b/src/Plugin/Validation/Constraint/SchedulerUnpublishOnConstraintValidator.php
@@ -19,7 +19,8 @@ class SchedulerUnpublishOnConstraintValidator extends ConstraintValidator {
    * {@inheritdoc}
    */
   public function validate($entity, Constraint $constraint) {
-    $scheduler_unpublish_required = $entity->getEntity()->type->entity->getThirdPartySetting('scheduler', 'unpublish_required', SCHEDULER_DEFAULT_UNPUBLISH_REQUIRED);
+    $default_unpublish_required = \Drupal::config('scheduler.settings')->get('default_unpublish_required');
+    $scheduler_unpublish_required = $entity->getEntity()->type->entity->getThirdPartySetting('scheduler', 'unpublish_required', $default_unpublish_required);
     $publish_on = $entity->getEntity()->publish_on->value;
     $unpublish_on = $entity->value;
 
diff --git a/src/SchedulerManager.php b/src/SchedulerManager.php
index 3b12244..cd34189 100644
--- a/src/SchedulerManager.php
+++ b/src/SchedulerManager.php
@@ -75,8 +75,8 @@ class SchedulerManager {
    * @return bool
    *   TRUE if any node has been published, FALSE otherwise.
    *
-   * @throws \Drupal\scheduler\Plugin\Exception\SchedulerMissingDateException
-   * @throws \Drupal\scheduler\Plugin\Exception\SchedulerNodeTypeNotEnabledException
+   * @throws \Drupal\scheduler\Exception\SchedulerMissingDateException
+   * @throws \Drupal\scheduler\Exception\SchedulerNodeTypeNotEnabledException
    */
   public function publish() {
     $result = FALSE;
@@ -101,7 +101,7 @@ class SchedulerManager {
     foreach ($nodes as $nid => $node) {
       // The API calls could return nodes of types which are not enabled for
       // scheduled publishing. Do not process these.
-      if (!$node->type->entity->getThirdPartySetting('scheduler', 'publish_enable', SCHEDULER_DEFAULT_PUBLISH_ENABLE)) {
+      if (!$node->type->entity->getThirdPartySetting('scheduler', 'publish_enable', $this->setting('default_publish_enable'))) {
         throw new SchedulerNodeTypeNotEnabledException(sprintf("Node %d '%s' will not be published because node type '%s' is not enabled for scheduled publishing", $node->id(), $node->getTitle(), node_get_type_label($node)));
         continue;
       }
@@ -127,11 +127,11 @@ class SchedulerManager {
       $publish_on = $node->publish_on->value;
       $node->set('changed', $publish_on);
       $old_creation_date = $node->getCreatedTime();
-      if ($node->type->entity->getThirdPartySetting('scheduler', 'publish_touch', SCHEDULER_DEFAULT_PUBLISH_TOUCH)) {
+      if ($node->type->entity->getThirdPartySetting('scheduler', 'publish_touch', $this->setting('default_publish_touch'))) {
         $node->setCreatedTime($publish_on);
       }
 
-      $create_publishing_revision = $node->type->entity->getThirdPartySetting('scheduler', 'publish_revision', SCHEDULER_DEFAULT_PUBLISH_REVISION);
+      $create_publishing_revision = $node->type->entity->getThirdPartySetting('scheduler', 'publish_revision', $this->setting('default_publush_revision'));
       if ($create_publishing_revision) {
         $node->setNewRevision();
         // Use a core date format to guarantee a time is included.
@@ -208,7 +208,7 @@ class SchedulerManager {
     foreach ($nodes as $nid => $node) {
       // The API calls could return nodes of types which are not enabled for
       // scheduled unpublishing. Do not process these.
-      if (!$node->type->entity->getThirdPartySetting('scheduler', 'unpublish_enable', SCHEDULER_DEFAULT_UNPUBLISH_ENABLE)) {
+      if (!$node->type->entity->getThirdPartySetting('scheduler', 'unpublish_enable', $this->setting('default_unpublish_enable'))) {
         throw new SchedulerNodeTypeNotEnabledException(sprintf("Node %d '%s' will not be unpublished because node type '%s' is not enabled for scheduled unpublishing", $node->id(), $node->getTitle(), node_get_type_label($node)));
         continue;
       }
@@ -243,7 +243,7 @@ class SchedulerManager {
       $unpublish_on = $node->unpublish_on->value;
       $node->set('changed', $unpublish_on);
 
-      $create_unpublishing_revision = $node->type->entity->getThirdPartySetting('scheduler', 'unpublish_revision', SCHEDULER_DEFAULT_UNPUBLISH_REVISION);
+      $create_unpublishing_revision = $node->type->entity->getThirdPartySetting('scheduler', 'unpublish_revision', $this->setting('default_unpublish_revision'));
       if ($create_unpublishing_revision) {
         $node->setNewRevision();
         // Use a core date format to guarantee a time is included.
@@ -351,7 +351,7 @@ class SchedulerManager {
    * /admin/config/content/scheduler/cron.
    */
   public function runCron() {
-    $log = $this->configFactory->get('scheduler.settings')->get('log');
+    $log = $this->setting('log');
     if ($log) {
       $this->logger->notice('Lightweight cron run activated.');
     }
@@ -367,4 +367,16 @@ class SchedulerManager {
     }
   }
 
+  /**
+   * Helper method to access the settings of this module.
+   *
+   * @param string $key
+   *   The key of the configuration.
+   *
+   * @return \Drupal\Core\Config\ImmutableConfig
+   */
+  protected function setting($key) {
+    return $this->configFactory->get('scheduler.settings')->get($key);
+  }
+
 }
