refactored selector selection logic