Improve denormalize to use Drupal API functions