Why is this not implemented using Drupal behaviors?