Moved  selector to a switch/case variable