Selector function.