phase1: move target enumeration to function