refactor HAL wrapper to be able to integrate auth with Gravity