Add ChooseByType optimization