moved hardware stuff into HAL