Refactor of the Drupal authentication client