refactored SelectorFunction