grc: refactor/enhance hier block generation