Begin rework for drupal7 version