Merged select into one function again

The performance benefit of the old way was negligable
and added more lines of code.