Finish refactor for HIF with extend and register.