hbformat, refactor