Simplifying select logic