some simplification of the select_inst_ths

and various cleanup/rename tweaks