refine selection logic