Issue #2789983 by hampercm, aks22: Make code compliant with Drupal coding standards and best practices