refactor(select): remove code duplication