Remove blank lines
Use .map and .reject instead of .each

Makes some of the code in the search builder clearer.