some hwbp refactoring