removing code duplication from selectors