diff --git a/translators/tmgmt_local/includes/tmgmt_local.info.inc b/translators/tmgmt_local/includes/tmgmt_local.info.inc
deleted file mode 100644
index 61da293..0000000
--- a/translators/tmgmt_local/includes/tmgmt_local.info.inc
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains the metadata controller classes for the local task translatio
- * entity.
- */
-
-/**
- * Metadata controller for the local task entity.
- */
-class TMGMTLocalTaskMetadataController extends EntityDefaultMetadataController {
-
-  /**
-   * {@inheritdoc}
-   */
-  public function entityPropertyInfo() {
-    $info = parent::entityPropertyInfo();
-//    $info = _tmgmt_override_property_description($info, $this->type);
-    $properties = &$info[$this->type]['properties'];
-
-    // Make the created and changed property appear as date.
-    $properties['changed']['type'] = $properties['created']['type'] = 'date';
-
-    // Add the options list for the defined status constants.
-    $properties['status']['options list'] = 'tmgmt_local_task_statuses';
-
-    // Link the job property to the corresponding job entity.
-    $properties['job'] = array(
-      'label' => t('Translation Job'),
-      'type' => 'tmgmt_job',
-      'description' => t('Corresponding job entity of the translation task.'),
-      'setter callback' => 'entity_property_verbatim_set',
-      'setter permission' => 'administer tmgmt',
-      'required' => TRUE,
-      'schema field' => 'tjid',
-    );
-
-    // Link the author property to the corresponding user entity.
-    $properties['author'] = array(
-      'label' => t('Author'),
-      'type' => 'user',
-      'description' => t('The author of the translation task.'),
-      'setter callback' => 'entity_property_verbatim_set',
-      'setter permission' => 'administer tmgmt',
-      'required' => TRUE,
-      'schema field' => 'uid',
-    );
-
-    // Link the author property to the corresponding user entity.
-    $properties['translator'] = array(
-      'label' => t('Translator'),
-      'type' => 'user',
-      'description' => t('The assigned translator for translation task.'),
-      'setter callback' => 'entity_property_verbatim_set',
-      'setter permission' => 'administer tmgmt',
-      'required' => TRUE,
-      'schema field' => 'tuid',
-    );
-
-    return $info;
-  }
-
-}
-
-
-/**
- * Metadata controller for the local task entity.
- */
-class TMGMTLocalTaskItemMetadataController extends EntityDefaultMetadataController {
-
-  /**
-   * {@inheritdoc}
-   */
-  public function entityPropertyInfo() {
-    $info = parent::entityPropertyInfo();
-    $properties = &$info[$this->type]['properties'];
-
-    // Add the options list for the defined status constants.
-    $properties['status']['options list'] = 'tmgmt_local_task_item_statuses';
-
-    // Link the job property to the corresponding job entity.
-    $properties['tjiid']['type'] = 'tmgmt_job_item';
-
-    // Link the author property to the corresponding user entity.
-    $properties['tltid']['type'] = 'tmgmt_local_task';
-
-    return $info;
-  }
-
-}
diff --git a/translators/tmgmt_local/includes/tmgmt_local.pages.inc b/translators/tmgmt_local/includes/tmgmt_local.pages.inc
deleted file mode 100644
index b06e59e..0000000
--- a/translators/tmgmt_local/includes/tmgmt_local.pages.inc
+++ /dev/null
@@ -1,519 +0,0 @@
-<?php
-
-/**
- * @file
- * Provides page and forms callbacks.
- */
-
-use Drupal\Component\Utility\NestedArray;
-use Drupal\Component\Utility\Xss;
-use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Url;
-use Drupal\tmgmt_local\Entity\LocalTask;
-use Drupal\tmgmt_local\Entity\LocalTaskItem;
-use Drupal\Core\Render\Element;
-use Drupal\tmgmt_local\LocalTaskInterface;
-use Drupal\user\Entity\User;
-
-/**
- * Simple page callback for viewing a task.
- *
- * @param \Drupal\tmgmt\JobInterface $task
- *   The viewed task.
- *
- * @return array
- *   A renderable array.
- */
-function tmgmt_local_task_view(LocalTask $task) {
-  return entity_view($task->getEntityTypeId(), array($task), 'full', NULL, TRUE);
-}
-
-/**
- * Entity API form the local task entity.
- */
-function tmgmt_local_task_form($form, FormStateInterface $form_state, LocalTask $task, $op = 'edit') {
-  $wrapper = entity_metadata_wrapper('tmgmt_local_task', $task);
-
-  // Set the title of the page to the label and the current status of the task.
-  $form['#title'] = (t('@label (@status)', array('@label' => $task->label(), '@status' => $wrapper->status->label())));
-
-  // Check if the translator entity is completely new or not.
-  $old = empty($task->is_new) && $op != 'clone';
-
-  $form['title'] = array(
-    '#type' => 'textfield',
-    '#title' => t('Title'),
-    '#default_value' => $task->title,
-    '#access' => user_access('administer tmgmt') || user_access('administer translation tasks'),
-  );
-
-  $form['status'] = array(
-    '#type' => 'select',
-    '#title' => t('Status'),
-    '#options' => LocalTask::getStatuses(),
-    '#default_value' => $wrapper->status->value(),
-    '#access' => user_access('administer tmgmt') || user_access('administer translation tasks'),
-  );
-
-  $translators = tmgmt_local_translators($task->getJob()->getSourceLanguage(), array($task->getJob()->getTargetLangcode()));
-  $form['tuid'] = array(
-    '#title' => t('Assigned'),
-    '#type' => 'select',
-    '#options' => $translators,
-    '#empty_option' => t('- Select user -'),
-    '#default_value' => $task->tuid,
-    '#access' => user_access('administer tmgmt') || user_access('administer translation tasks'),
-  );
-
-  if ($view = views_get_view('tmgmt_local_task_items')) {
-    $form['items'] = array(
-      '#type' => 'item',
-      '#title' => $view->get_title(),
-      '#prefix' => '<div class="tmgmt-local-task-items">',
-      '#markup' => $view->preview('block', array($task->tltid)),
-      '#attributes' => array('class' => array('tmgmt-local-task-items')),
-      '#suffix' => '</div>',
-      '#weight' => 10,
-    );
-  }
-
-  // Add the buttons and action links.
-  $form['actions']['#type'] = 'actions';
-  $form['actions']['#access'] = user_access('administer tmgmt') || user_access('administer translation tasks');
-  $form['actions']['submit'] = array(
-    '#type' => 'submit',
-    '#value' => t('Save task'),
-  );
-
-  if ($old) {
-    $form['actions']['delete'] = array(
-      '#type' => 'submit',
-      '#value' => t('Delete'),
-      '#redirect' => 'translate/' . $task->tltid . '/delete',
-      // Don't run validations, so the user can always delete the job.
-      '#limit_validation_errors' => array(),
-    );
-  }
-
-  return $form;
-}
-
-/**
- * Submit callback for the local task form.
- */
-function tmgmt_local_task_form_submit($form, FormStateInterface $form_state) {
-  $task = entity_ui_form_submit_build_entity($form, $form_state);
-  // If the task isn't assigned to anyone but doesn't have the unassigned status
-  // update it.
-  if ($task->tuid == 0 && !$task->isUnassigned()) {
-    $task->unassign();
-  }
-  $task->save();
-}
-
-
-
-/**
- * Simple page callback for viewing a task.
- *
- * @param TMGMTLocalTaskItem $item
- *   The viewed task item
- *
- * @return array
- *   A renderable array.
- */
-function tmgmt_local_task_item_view(LocalTaskItem $item) {
-  return entity_view($item->getEntityTypeId(), array($item), 'full', NULL, TRUE);
-}
-
-/**
- * Assign task to current user.
- *
- * @param TMGMTLocalTask $task
- */
-function tmgmt_local_translation_assign_to_me(TMGMTLocalTask $task) {
-  $task->assign(\Drupal::currentUser());
-  $task->save();
-  drupal_goto('translate');
-}
-
-/**
- * Form callback for translating a job item.
- */
-function tmgmt_local_translation_form($form, FormStateInterface $form_state, TMGMTLocalTaskItem $task_item) {
-  $form_state['task'] = $task_item->getTask();
-  $form_state['task_item'] = $task_item;
-  $form_state['job_item'] = $job_item = $task_item->getJobItem();
-
-  $job = $job_item->getJob();
-
-  if ($job->getSetting('job_comment')) {
-    $form['job_comment'] = array(
-      '#type' => 'item',
-      '#title' => t('Job comment'),
-      '#markup' => Xss::filter($job->getSetting('job_comment')),
-    );
-  }
-
-  $form['translation'] = array(
-    '#type' => 'container',
-  );
-
-  // Build the translation form.
-  $data = $job_item->getData();
-
-  // Need to keep the first hierarchy. So flatten must take place inside
-  // of the foreach loop.
-  $zebra = 'even';
-  // Reverse the order to get the correct order.
-  foreach (array_reverse(Element::children($data)) as $key) {
-    $flattened = \Drupal::service('tmgmt.data')->flatten($data[$key], $key);
-    $form['translation'][$key] = tmgmt_local_translation_form_element($flattened, $task_item, $zebra);
-  }
-
-  // Add the form actions as well.
-  $form['actions']['#type'] = 'actions';
-  $form['actions']['save_as_completed'] = array(
-    '#type' => 'submit',
-    '#validate' => array('tmgmt_local_translation_form_save_as_completed_validate'),
-    '#submit' => array('tmgmt_local_translation_form_save_submit', 'tmgmt_local_translation_form_save_as_completed_submit'),
-    '#value' => t('Save as completed'),
-  );
-  $form['actions']['save'] = array(
-    '#type' => 'submit',
-    '#submit' => array('tmgmt_local_translation_form_save_submit'),
-    '#value' => t('Save'),
-  );
-
-  return $form;
-}
-
-/**
- * Form validate callback for save as completed submit action.
- *
- * Verify that all items are translated.
- */
-function tmgmt_local_translation_form_save_as_completed_validate($form, FormStateInterface $form_state) {
-  // Loop over all data items and verify that there is a translation in there.
-  foreach ($form_state['values'] as $key => $value) {
-    if (is_array($value) && isset($value['translation'])) {
-      if (empty($value['translation'])) {
-        form_set_error($key . '[translation]', t('Missing translation.'));
-      }
-    }
-  }
-}
-
-/**
- * Form submit callback for save as completed submit action.
- *
- * Change items to needs review state and task to completed status.
- */
-function tmgmt_local_translation_form_save_as_completed_submit($form, FormStateInterface $form_state) {
-  /**
-   * @var \Drupal\tmgmt_local\Entity\LocalTask $task
-   */
-  $task = $form_state['task'];
-
-  /**
-   * @var \Drupal\tmgmt_local\Entity\LocalTaskItem $task_item
-   */
-  $task_item = $form_state['task_item'];
-  $task_item->completed();
-  $task_item->save();
-
-  // Mark the task as completed if all assigned job items are at needs done.
-  $all_done = TRUE;
-  foreach ($task->getItems() as $item) {
-    if ($item->isPending()) {
-      $all_done = FALSE;
-      break;
-    }
-  }
-  if ($all_done) {
-    $task->setStatus(LocalTaskInterface::STATUS_COMPLETED);
-    // If the task is now completed, redirect back to the overview.
-    $form_state['redirect'] = 'translate';
-  }
-  else {
-    // If there are more task items, redirect back to the task.
-    $form_state->setRedirectUrl($task->urlInfo());
-  }
-
-  /**
-   * @var \Drupal\tmgmt\JobItemInterface $job_item.
-   */
-  $job_item = $form_state['job_item'];
-
-  // Add the translations to the job item.
-  $job_item->addTranslatedData($task_item->getData());
-}
-
-/**
- * Form submit callback for save action.
- *
- * Saves all items.
- */
-function tmgmt_local_translation_form_save_submit($form, FormStateInterface $form_state) {
-  /**
-   * @var TMGMTTaskItem $task_item.
-   */
-  $task_item = $form_state['task_item'];
-
-  // Write the translated data into the task item.
-  form_state_values_clean($form_state);
-  foreach ($form_state['values'] as $key => $value) {
-    if (is_array($value) && isset($value['translation'])) {
-      $update['#text'] = $value['translation'];
-      $task_item->updateData($key, $update);
-    }
-  }
-  $task_item->save();
-
-  $task = $form_state['task'];
-  $uri = $task->uri();
-  $form_state['redirect'] = $uri['path'];
-}
-
-/**
- * Builds a translation form element.
- */
-function tmgmt_local_translation_form_element($data, LocalTaskItem $item, &$zebra) {
-  static $flip = array(
-    'even' => 'odd',
-    'odd' => 'even',
-  );
-
-  $form = array();
-
-  $job = $item->getJobItem()->getJob();
-
-  foreach (Element::children($data) as $key) {
-    if (isset($data[$key]['#text']) && \Drupal::service('tmgmt.data')->filterData($data[$key])) {
-      // The char sequence '][' confuses the form API so we need to replace it.
-      $target_key = str_replace('][', '|', $key);
-      $zebra = $flip[$zebra];
-      $form[$target_key] = array(
-        '#tree' => TRUE,
-        '#ajaxid' => drupal_html_id('tmgmt-local-element-' . $key),
-        '#theme' => 'tmgmt_local_translation_form_element',
-        '#parent_label' => $data[$key]['#parent_label'],
-        '#zebra' => $zebra,
-      );
-
-      $form[$target_key]['source'] = array(
-        '#type' => 'textarea',
-        '#title' => $job->getSourceLanguage()->getName(),
-        '#value' => $data[$key]['#text'],
-        '#disabled' => TRUE,
-      );
-
-      $form[$target_key]['translation'] = array(
-        '#type' => 'textarea',
-        '#title' => $job->getTargetLanguage()->getName(),
-        '#default_value' => $item->getData(\Drupal::service('tmgmt.data')->ensureArrayKey($key), '#text'),
-        //'#required' => TRUE,
-      );
-
-      $form[$target_key]['actions'] = array(
-        '#type' => 'container',
-      );
-      $status = $item->getData(\Drupal::service('tmgmt.data')->ensureArrayKey($key), '#status');
-      $completed = $status == TMGMT_DATA_ITEM_STATE_TRANSLATED;
-      if ($completed) {
-        $form[$target_key]['actions']['reject-' . $target_key] = array(
-          '#type' => 'submit',
-          // Unicode character &#x2717 BALLOT X
-          '#value' => '✗',
-          '#attributes' => array('title' => t('Reject')),
-          '#name' => 'reject-' . $target_key,
-          '#submit' => array('tmgmt_local_translation_form_update_state_submit'),
-          '#ajax' => array(
-            'callback' => 'tmgmt_local_translation_form_update_state_ajax',
-            'wrapper' => $form[$target_key]['#ajaxid'],
-          ),
-          '#tmgmt_local_action' => 'reject',
-          '#tmgmt_local_key' => str_replace('][', '|', $key),
-        );
-      }
-      else {
-        $form[$target_key]['actions']['finish-' . $target_key] = array(
-          '#type' => 'submit',
-          // Unicode character &#x2713 CHECK MARK
-          '#value' => '✓',
-          '#attributes' => array('title' => t('Finish')),
-          '#name' => 'finish-' . $target_key,
-          '#submit' => array('tmgmt_local_translation_form_update_state_submit'),
-          '#ajax' => array(
-            'callback' => 'tmgmt_local_translation_form_update_state_ajax',
-            'wrapper' => $form[$target_key]['#ajaxid'],
-          ),
-          '#tmgmt_local_action' => 'finish',
-          '#tmgmt_local_key' => str_replace('][', '|', $key),
-        );
-      }
-    }
-  }
-
-  return $form;
-}
-
-/**
- * Form submit callback for the translation state update button.
- */
-function tmgmt_local_translation_form_update_state_submit($form, FormStateInterface $form_state) {
-  $values = $form_state['values'];
-
-  /**
-   * @var TMGMTLocalTaskItem $item.
-   */
-  $item = $form_state['task_item'];
-
-  $action = $form_state['triggering_element']['#tmgmt_local_action'];
-  $key = $form_state['triggering_element']['#tmgmt_local_key'];
-
-  // Write the translated data into the job item.
-  if (isset($values[$key]) && is_array($values[$key]) && isset($values[$key]['translation'])) {
-    $update['#status'] = $action == 'finish' ? TMGMT_DATA_ITEM_STATE_TRANSLATED : TMGMT_DATA_ITEM_STATE_PENDING;
-    $update['#text'] = $values[$key]['translation'];
-    $item->updateData($key, $update);
-    $item->save();
-
-    // We need to rebuild form so we get updated action button state.
-    $form_state['rebuild'] = TRUE;
-  }
-}
-
-/**
- * Ajax callback for the job item review form.
- */
-function tmgmt_local_translation_form_update_state_ajax($form, FormStateInterface $form_state) {
-  $key = array_slice($form_state['triggering_element']['#array_parents'], 0, 3);
-  $commands = array();
-  $render_data = NestedArray::getValue($form, $key);
-  $commands[] = ajax_command_replace(NULL, \Drupal::service('renderer')->render($render_data));
-  tmgmt_write_request_messages($form_state['job_item']->getJob());
-  $commands[] = ajax_command_html('#tmgmt-status-messages-' . strtolower($render_data['#parent_label'][0]), theme('status_messages'));
-  return array('#type' => 'ajax', '#commands' => $commands);
-}
-
-/**
- * Form for assigning multiple tasks to translator.
- *
- * @param array $form
- * @param array $form_state
- * @param string $tasks
- *  Comma separated tasks ids.
- *
- * @return array
- *   Drupal form definition.
- */
-function tmgmt_local_translation_assign_form($form, FormStateInterface $form_state, $tasks) {
-  $form_state['tasks'] = explode(',', $tasks);
-
-  $roles = tmgmt_local_translator_roles();
-  if (empty($roles)) {
-    drupal_set_message(t('No user role has the "provide translation services" permission. <a href="@url">Configure permissions</a> for the Local translator module.',
-      array('@url' => Url::fromRoute('user.admin_permissions')->toString())), 'warning');
-  }
-
-  $form['tuid'] = array(
-    '#title' => t('Assign to'),
-    '#type' => 'select',
-    '#empty_option' => t('Select user'),
-    '#options' => tmgmt_local_get_translators_for_tasks($form_state['tasks']),
-    '#required' => TRUE,
-  );
-
-  $form['actions']['#type'] = 'actions';
-  $form['actions']['submit'] = array(
-    '#type' => 'submit',
-    '#value' => t('Assign tasks'),
-  );
-
-  return $form;
-}
-
-/**
- * Submit handler for form for assigning multiple tasks to translator.
- */
-function tmgmt_local_translation_assign_form_submit($form, FormStateInterface $form_state) {
-  $translator = User::load($form_state['values']['tuid']);
-
-  $how_many = 0;
-  foreach ($form_state['tasks'] as $task_id) {
-    $task = tmgmt_local_task_load($task_id);
-    if ($task) {
-      $task->assign($translator);
-      $task->save();
-      ++$how_many;
-    }
-  }
-
-  drupal_set_message(t('Assigned @how_many to translator @translator_name.', array('@how_many' => $how_many, '@translator_name' => $translator->id())));
-
-  $form_state['redirect'] = 'manage-translate';
-}
-
-/**
- * Similar to form for assigning multiple tasks to translator, but here we also
- * allow no user selection.
- *
- * @see tmgmt_local_translation_assign_form().
- */
-function tmgmt_local_translation_reassign_form($form, FormStateInterface $form_state, $tasks) {
-  $form_state['tasks'] = explode(',', $tasks);
-
-  $roles = tmgmt_local_translator_roles();
-  if (empty($roles)) {
-    drupal_set_message(t('No user role has the "provide translation services" permission. <a href="@url">Configure permissions</a> for the Local translator module.',
-      array('@url' => Url::fromRoute('user.admin_permissions')->toString())), 'warning');
-  }
-
-  $form['tuid'] = array(
-    '#title' => t('Assign to'),
-    '#type' => 'select',
-    '#empty_option' => t('Select user'),
-    '#options' => tmgmt_local_get_translators_for_tasks($form_state['tasks']),
-  );
-
-  $form['actions']['#type'] = 'actions';
-  $form['actions']['submit'] = array(
-    '#type' => 'submit',
-    '#value' => t('Reassign tasks'),
-  );
-
-  return $form;
-}
-
-/**
- * Submit handler for form for reassigning multiple tasks to translator.
- */
-function tmgmt_local_translation_reassign_form_submit($form, FormStateInterface $form_state) {
-
-  if (!empty($form_state['values']['tuid'])) {
-    $translator = User::load($form_state['values']['tuid']);
-  }
-  else {
-    $translator = (object) array('uid' => 0, 'name' => t('none'));
-  }
-
-  $how_many = 0;
-  foreach ($form_state['tasks'] as $task_id) {
-    $task = tmgmt_local_task_load($task_id);
-    if ($task) {
-      if ($translator->id()) {
-        $task->assign($translator);
-      }
-      else {
-        $task->unassign();
-      }
-      $task->save();
-      ++$how_many;
-    }
-  }
-
-  drupal_set_message(t('Reassigned @how_many to translator @translator_name.', array('@how_many' => $how_many, '@translator_name' => $translator->id())));
-
-  $form_state['redirect'] = 'manage-translate';
-}
diff --git a/translators/tmgmt_local/includes/tmgmt_local.theme.inc b/translators/tmgmt_local/includes/tmgmt_local.theme.inc
deleted file mode 100644
index 683debd..0000000
--- a/translators/tmgmt_local/includes/tmgmt_local.theme.inc
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-
-use Drupal\Core\Render\Element;
-/**
- * Renders a tables containing a group of data items belonging to the same field.
- */
-function theme_tmgmt_local_translation_form($variables) {
-  $result = '';
-
-  // Get through all available translations.
-  $translation = $variables['element']['translation'];
-  foreach (Element::children($translation) as $children_name) {
-    $children = $translation[$children_name];
-    $result .= \Drupal::service('renderer')->render($children);
-  }
-
-  // We have rendered translation children so lets remove them.
-  unset($variables['element']['translation']);
-
-  // Render the rest of elements(form actions, CSRF tokens, etc.)
-  $result .= drupal_render_children($variables['element']);
-
-  return $result;
-}
-
-/**
- * Renders a table for one data item.
- */
-function theme_tmgmt_local_translation_form_element($variables) {
-  // Theme table which contains source, translation and action state button.
-  $element = $variables['element'];
-
-  $parts = explode('|', $element['#parents'][0]);
-  $header_title = ucfirst(str_replace('_', ' ', $parts[0]));
-
-  // Container for ajax messages.
-  $result = '<div id="tmgmt-status-messages-' . strtolower($element['#parent_label'][0]) . '"></div>';
-
-  $result .= theme('table', array(
-    'attributes' => array('id' => $element['#ajaxid'], 'class' => array($element['#zebra'])),
-    'header' => array(array(
-      'data' => $header_title,
-      'colspan' => 3,
-    )),
-    'rows' => array(
-      array(
-        'data' => array(
-          \Drupal::service('renderer')->render($element['source']),
-          \Drupal::service('renderer')->render($element['translation']),
-          \Drupal::service('renderer')->render($element['actions']),
-        ),
-      ),
-    ),
-  ));
-
-  return $result;
-}
diff --git a/translators/tmgmt_local/src/Entity/LocalTaskItem.php b/translators/tmgmt_local/src/Entity/LocalTaskItem.php
index cb63bdf..4afa590 100644
--- a/translators/tmgmt_local/src/Entity/LocalTaskItem.php
+++ b/translators/tmgmt_local/src/Entity/LocalTaskItem.php
@@ -1,6 +1,6 @@
 <?php
 
-/*
+/**
  * @file
  * Contains \Drupal\tmgmt_local\Entity\LocalTaskItem.
  */
@@ -8,14 +8,13 @@
 namespace Drupal\tmgmt_local\Entity;
 
 use Drupal\Component\Utility\NestedArray;
-use Drupal\Core\Entity\Annotation\ContentEntityType;
 use Drupal\Core\Entity\ContentEntityBase;
-use Drupal\Core\Entity\EntityChangedInterface;
 use Drupal\Core\Entity\EntityChangedTrait;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\Render\Element;
+use Drupal\tmgmt_local\LocalTaskItemInterface;
 
 
 /**
@@ -45,7 +44,7 @@ use Drupal\Core\Render\Element;
  *
  * @ingroup tmgmt_local_task
  */
-class LocalTaskItem extends ContentEntityBase implements EntityChangedInterface {
+class LocalTaskItem extends ContentEntityBase implements LocalTaskItemInterface {
 
   use EntityChangedTrait;
 
@@ -90,7 +89,7 @@ class LocalTaskItem extends ContentEntityBase implements EntityChangedInterface
     $fields['status'] = BaseFieldDefinition::create('integer')
       ->setLabel(t('Local task item status'))
       ->setDescription(t('The local task item status'))
-      ->setDefaultValue(TMGMT_LOCAL_TASK_ITEM_STATUS_PENDING);
+      ->setDefaultValue(LocalTaskItemInterface::STATUS_PENDING);
 
     $fields['changed'] = BaseFieldDefinition::create('changed')
       ->setLabel(t('Changed'))
@@ -126,78 +125,56 @@ class LocalTaskItem extends ContentEntityBase implements EntityChangedInterface
   }
 
   /**
-   * Returns the translation task.
-   *
-   * @return LocalTask
+   * {@inheritdoc}
    */
   public function getTask() {
     return $this->get('tltid')->entity;
   }
 
   /**
-   * Returns the translation job item.
-   *
-   * @return \Drupal\tmgmt\JobItemInterface
+   * {@inheritdoc}
    */
   public function getJobItem() {
     return $this->get('tjiid')->entity;
   }
 
   /**
-   * Returns TRUE if the local task is pending.
-   *
-   * @return bool
-   *   TRUE if the local task item is untranslated.
+   * {@inheritdoc}
    */
   public function isPending() {
-    return $this->status->value == TMGMT_LOCAL_TASK_ITEM_STATUS_PENDING;
+    return $this->get('status')->value == LocalTaskItemInterface::STATUS_PENDING;
   }
 
   /**
-   * Returns TRUE if the local task is translated (fully translated).
-   *
-   * @return bool
-   *   TRUE if the local task item is translated.
+   * {@inheritdoc}
    */
   public function isCompleted() {
-    return $this->status->value == TMGMT_LOCAL_TASK_ITEM_STATUS_COMPLETED;
+    return $this->get('status')->value == LocalTaskItemInterface::STATUS_COMPLETED;
   }
 
   /**
-   * Rreturns TRUE if the local task is closed (translated and accepted).
-   *
-   * @return bool
-   *   TRUE if the local task item is translated and accepted.
+   * {@inheritdoc}
    */
   public function isClosed() {
-    return $this->status->value == TMGMT_LOCAL_TASK_ITEM_STATUS_CLOSED;
+    return $this->get('status')->value == LocalTaskItemInterface::STATUS_CLOSED;
   }
 
   /**
-   * Sets the task item status to completed.
+   * {@inheritdoc}
    */
   public function completed() {
-    $this->status = TMGMT_LOCAL_TASK_ITEM_STATUS_COMPLETED;
+    $this->set('status', LocalTaskItemInterface::STATUS_COMPLETED);
   }
 
   /**
-   * Sets the task item status to closed.
+   * {@inheritdoc}
    */
   public function closed() {
-    $this->status = TMGMT_LOCAL_TASK_ITEM_STATUS_CLOSED;
+    $this->set('status', LocalTaskItemInterface::STATUS_CLOSED);
   }
 
   /**
-   * Updates the values for a specific substructure in the data array.
-   *
-   * The values are either set or updated but never deleted.
-   *
-   * @param $key
-   *   Key pointing to the item the values should be applied.
-   *   The key can be either be an array containing the keys of a nested array
-   *   hierarchy path or a string with '][' or '|' as delimiter.
-   * @param $values
-   *   Nested array of values to set.
+   * {@inheritdoc}
    */
   public function updateData($key, $values = array(), $replace = FALSE) {
     if ($replace) {
@@ -227,24 +204,7 @@ class LocalTaskItem extends ContentEntityBase implements EntityChangedInterface
   }
 
   /**
-   * Array of translations.
-   *
-   * The structure is similar to the form API in the way that it is a possibly
-   * nested array with the following properties whose presence indicate that the
-   * current element is a text that might need to be translated.
-   *
-   * - #text: The translated text of the corresponding entry in the job item.
-   * - #status: The status of the translation.
-   *
-   * The key can be an alphanumeric string.
-   *
-   * @param array $key
-   *   If present, only the subarray identified by key is returned.
-   * @param string $index
-   *   Optional index of an attribute below $key.
-   *
-   * @return array
-   *   A structured data array.
+   * {@inheritdoc}
    */
   public function getData($key = array(), $index = NULL) {
     if (empty($this->unserializedData) && $this->get('data')->value) {
@@ -265,33 +225,24 @@ class LocalTaskItem extends ContentEntityBase implements EntityChangedInterface
   }
 
   /**
-   * Count of all translated data items.
-   *
-   * @return
-   *   Translated count
+   * {@inheritdoc}
    */
   public function getCountTranslated() {
-    return $this->count_translated->value;
+    return $this->get('count_translated')->value;
   }
 
   /**
-   * Count of all untranslated data items.
-   *
-   * @return
-   *   Translated count
+   * {@inheritdoc}
    */
   public function getCountUntranslated() {
-    return $this->count_untranslated->value;
+    return $this->get('count_untranslated')->value;
   }
 
   /**
-   * Count of all completed data items.
-   *
-   * @return
-   *   Translated count
+   * {@inheritdoc}
    */
   public function getCountCompleted() {
-    return $this->count_completed->value;
+    return $this->get('count_completed')->value;
   }
 
   /**
@@ -303,10 +254,10 @@ class LocalTaskItem extends ContentEntityBase implements EntityChangedInterface
       $this->recalculateStatistics();
     }
     if ($this->unserializedData) {
-      $this->data = serialize($this->unserializedData);
+      $this->set('data', serialize($this->unserializedData));
     }
     elseif (empty($this->get('data')->value)) {
-      $this->data = serialize(array());
+      $this->set('data', serialize(array()));
     }
   }
 
@@ -325,35 +276,31 @@ class LocalTaskItem extends ContentEntityBase implements EntityChangedInterface
 
     // Consider everything accepted when the job item is accepted.
     if ($this->isCompleted() || $this->isClosed()) {
-      $this->count_pending = 0;
-      $this->count_translated = 0;
-      $this->count_reviewed = 0;
-      $this->count_completed = count(array_filter(\Drupal::service('tmgmt.data')->flatten($this->unserializedData), array(\Drupal::service('tmgmt.data'), 'filterData')));
-      $this->count_untranslated = 0;
+      $this->set('count_translated', 0);
+      $this->set('count_completed', count(array_filter(\Drupal::service('tmgmt.data')->flatten($this->unserializedData), array(\Drupal::service('tmgmt.data'), 'filterData'))));
+      $this->set('count_untranslated', 0);
     }
     // Count the data item states.
     else {
       // Reset counter values.
-      $this->count_pending = 0;
-      $this->count_translated = 0;
-      $this->count_reviewed = 0;
-      $this->count_completed = 0;
-      $this->word_count = 0;
-      $this->count_untranslated = count(array_filter(\Drupal::service('tmgmt.data')->flatten($this->unserializedData), array(\Drupal::service('tmgmt.data'), 'filterData')));
+      $this->set('count_translated', 0);
+      $this->set('count_completed', 0);
+      $this->set('word_count', 0);
+      $this->set('count_untranslated', count(array_filter(\Drupal::service('tmgmt.data')->flatten($this->unserializedData), array(\Drupal::service('tmgmt.data'), 'filterData'))));
       $this->count($this->unserializedData);
     }
   }
 
   /**
+   * Counts accepted, translated and pending items.
+   *
    * Parse all data items recursively and sums up the counters for
    * accepted, translated and pending items.
    *
-   * @param $item
+   * @param array $item
    *   The current data item.
-   * @param $this
-   *   The job item the count should be calculated.
    */
-  protected function count(&$item) {
+  protected function count(array &$item) {
     if (!empty($item['#text'])) {
       if (\Drupal::service('tmgmt.data')->filterData($item)) {
 
@@ -363,8 +310,8 @@ class LocalTaskItem extends ContentEntityBase implements EntityChangedInterface
         }
         switch ($item['#status']) {
           case TMGMT_DATA_ITEM_STATE_TRANSLATED:
-            $this->count_untranslated = $this->count_untranslated->value - 1;
-            $this->count_translated = $this->count_translated->value + 1;
+            $this->set('count_untranslated', $this->get('count_untranslated')->value - 1);
+            $this->set('count_translated', $this->get('count_translated')->value + 1);
             break;
         }
       }
@@ -377,14 +324,25 @@ class LocalTaskItem extends ContentEntityBase implements EntityChangedInterface
   }
 
   /**
-   * Gets the timestamp of the last entity change across all translations.
-   *
-   * @return int
-   *   The timestamp of the last entity save operation across all
-   *   translations.
+   * {@inheritdoc}
    */
   public function getChangedTimeAcrossTranslations() {
     return $this->getChangedTime();
   }
 
+  /**
+   * Retrieve a labeled list of all available statuses for task items.
+   *
+   * @return array
+   *   A list of all available statuses.
+   */
+  public static function getStatuses() {
+    return array(
+      LocalTaskItemInterface::STATUS_PENDING => t('Untranslated'),
+      LocalTaskItemInterface::STATUS_COMPLETED => t('Translated'),
+      LocalTaskItemInterface::STATUS_REJECTED => t('Rejected'),
+      LocalTaskItemInterface::STATUS_CLOSED => t('Completed'),
+    );
+  }
+
 }
diff --git a/translators/tmgmt_local/src/LocalTaskItemInterface.php b/translators/tmgmt_local/src/LocalTaskItemInterface.php
new file mode 100644
index 0000000..ad5c7d8
--- /dev/null
+++ b/translators/tmgmt_local/src/LocalTaskItemInterface.php
@@ -0,0 +1,166 @@
+<?php
+
+/**
+ * @file
+ * Contains Drupal\tmgmt_local\LocalTaskItemInterface.
+ */
+
+namespace Drupal\tmgmt_local;
+
+use Drupal\Core\Entity\ContentEntityInterface;
+use Drupal\Core\Entity\EntityChangedInterface;
+
+/**
+ * Interface for tmgmt_local_task_item entity.
+ *
+ * @ingroup tmgmt_local_task_item
+ */
+interface LocalTaskItemInterface extends ContentEntityInterface, EntityChangedInterface {
+
+  /**
+   * Translation task item is untranslated.
+   */
+  const STATUS_PENDING = 0;
+
+  /**
+   * Translation task item is translated and pending review of the job item.
+   */
+  const STATUS_COMPLETED = 1;
+
+  /**
+   * Translation job item has been rejected and the task needs to be updated.
+   */
+  const STATUS_REJECTED = 2;
+
+  /**
+   * The translation task item has been completed and closed.
+   */
+  const STATUS_CLOSED = 3;
+
+  /**
+   * Returns the translation task.
+   *
+   * @return \Drupal\tmgmt_local\Entity\LocalTask
+   *   The LocalTask.
+   */
+  public function getTask();
+
+  /**
+   * Returns the translation job item.
+   *
+   * @return \Drupal\tmgmt\JobItemInterface
+   *   The JobItem.
+   */
+  public function getJobItem();
+
+  /**
+   * Returns TRUE if the local task is pending.
+   *
+   * @return bool
+   *   TRUE if the local task item is untranslated.
+   */
+  public function isPending();
+
+  /**
+   * Returns TRUE if the local task is translated (fully translated).
+   *
+   * @return bool
+   *   TRUE if the local task item is translated.
+   */
+  public function isCompleted();
+
+  /**
+   * Rreturns TRUE if the local task is closed (translated and accepted).
+   *
+   * @return bool
+   *   TRUE if the local task item is translated and accepted.
+   */
+  public function isClosed();
+
+  /**
+   * Sets the task item status to completed.
+   */
+  public function completed();
+
+  /**
+   * Sets the task item status to closed.
+   */
+  public function closed();
+
+  /**
+   * Updates the values for a specific substructure in the data array.
+   *
+   * The values are either set or updated but never deleted.
+   *
+   * @param string|array $key
+   *   Key pointing to the item the values should be applied.
+   *   The key can be either be an array containing the keys of a nested array
+   *   hierarchy path or a string with '][' or '|' as delimiter.
+   * @param array $values
+   *   Nested array of values to set.
+   * @param bool $replace
+   *   (optional) When TRUE, replaces the structure at the provided key instead
+   *   of writing into it.
+   */
+  public function updateData($key, $values = array(), $replace = FALSE);
+
+  /**
+   * Array of translations.
+   *
+   * The structure is similar to the form API in the way that it is a possibly
+   * nested array with the following properties whose presence indicate that the
+   * current element is a text that might need to be translated.
+   *
+   * - #text: The translated text of the corresponding entry in the job item.
+   * - #status: The status of the translation.
+   *
+   * The key can be an alphanumeric string.
+   *
+   * @param array $key
+   *   If present, only the subarray identified by key is returned.
+   * @param string $index
+   *   Optional index of an attribute below $key.
+   *
+   * @return array
+   *   A structured data array.
+   */
+  public function getData($key = array(), $index = NULL);
+
+  /**
+   * Count of all translated data items.
+   *
+   * @return int
+   *   Translated count
+   */
+  public function getCountTranslated();
+
+  /**
+   * Count of all untranslated data items.
+   *
+   * @return int
+   *   Translated count
+   */
+  public function getCountUntranslated();
+
+  /**
+   * Count of all completed data items.
+   *
+   * @return int
+   *   Translated count
+   */
+  public function getCountCompleted();
+
+  /**
+   * Recalculate statistical word-data: pending, completed, rejected, closed.
+   */
+  public function recalculateStatistics();
+
+  /**
+   * Returns a labeled list of all available statuses.
+   *
+   * @return array
+   *   A list of all available statuses.
+   */
+  public static function getStatuses();
+
+}
diff --git a/translators/tmgmt_local/src/Plugin/views/field/TaskItemStatus.php b/translators/tmgmt_local/src/Plugin/views/field/TaskItemStatus.php
index dd324e6..9fba3be 100644
--- a/translators/tmgmt_local/src/Plugin/views/field/TaskItemStatus.php
+++ b/translators/tmgmt_local/src/Plugin/views/field/TaskItemStatus.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\tmgmt_local\Plugin\views\field;
 
+use Drupal\tmgmt_local\Entity\LocalTaskItem;
 use Drupal\views\Plugin\views\field\NumericField;
 use Drupal\views\ResultRow;
 
@@ -25,7 +26,7 @@ class TaskItemStatus extends NumericField {
 
     $element = [
       '#type' => 'item',
-      '#markup' => tmgmt_local_task_item_statuses()[$value],
+      '#markup' => LocalTaskItem::getStatuses()[$value],
     ];
     return \Drupal::service('renderer')->render($element);
   }
diff --git a/translators/tmgmt_local/tmgmt_local.module b/translators/tmgmt_local/tmgmt_local.module
index 123155f..39bef8a 100755
--- a/translators/tmgmt_local/tmgmt_local.module
+++ b/translators/tmgmt_local/tmgmt_local.module
@@ -3,6 +3,7 @@ use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\StringTranslation\TranslatableMarkup;
 use Drupal\tmgmt_local\LocalTaskInterface;
+use Drupal\tmgmt_local\LocalTaskItemInterface;
 use Drupal\user\Entity\User;
 use Drupal\tmgmt\Entity\Translator;
 use Drupal\tmgmt\JobInterface;
@@ -41,26 +42,6 @@ define('TMGMT_LOCAL_TRANSLATION_ACCESS_DENY', 'deny');
 define('TMGMT_LOCAL_TRANSLATION_ACCESS_IGNORE', NULL);
 
 /**
- * Translation task item is untranslated.
- */
-define('TMGMT_LOCAL_TASK_ITEM_STATUS_PENDING', 0);
-
-/**
- * Translation task item is translated and pending review of the job item.
- */
-define('TMGMT_LOCAL_TASK_ITEM_STATUS_COMPLETED', 1);
-
-/**
- * Translation job item has been rejected and the task needs to be updated.
- */
-define('TMGMT_LOCAL_TASK_ITEM_STATUS_REJECTED', 2);
-
-/**
- * The translation task item has been completed and closed.
- */
-define('TMGMT_LOCAL_TASK_ITEM_STATUS_CLOSED', 3);
-
-/**
  * Untranslated translation data item.
  */
 define('TMGMT_DATA_ITEM_STATE_UNTRANSLATED', 0);
@@ -384,21 +365,6 @@ function tmgmt_local_task_statistic(LocalTask $task, $key) {
 }
 
 /**
- * Retrieve a labeled list of all available statuses for task items.
- *
- * @return array
- *   A list of all available statuses.
- */
-function tmgmt_local_task_item_statuses() {
-  return $statuses = array(
-    TMGMT_LOCAL_TASK_ITEM_STATUS_PENDING => t('Untranslated'),
-    TMGMT_LOCAL_TASK_ITEM_STATUS_COMPLETED => t('Translated'),
-    TMGMT_LOCAL_TASK_ITEM_STATUS_REJECTED => t('Rejected'),
-    TMGMT_LOCAL_TASK_ITEM_STATUS_CLOSED => t('Completed'),
-  );
-}
-
-/**
  * Gets all involved language pairs for given tasks.
  *
  * @param array $tasks
@@ -473,7 +439,7 @@ function tmgmt_local_tmgmt_job_item_update(JobItemInterface $job_item) {
       // Check if the task can be marked as closed as well.
       $unclosed_tasks = \Drupal::entityQuery('tmgmt_local_task_item')
         ->condition('tltid', $task_item->id())
-        ->condition('status', TMGMT_LOCAL_TASK_ITEM_STATUS_CLOSED, '<>')
+        ->condition('status', LocalTaskItemInterface::STATUS_CLOSED, '<>')
         ->count()
         ->execute();
       if ($unclosed_tasks == 0) {
