holoirc: rearrange code