Refactored selectOptions to reduce redundancy of code