Refactoring HAL