Clean up filter querying with whereIf, which is kind of a hack