Change structure and update code for Drupal 7 usage