clean up selection logic