simplify type of doBranch