HAL refactoring