Reduced duplication in filter specs
Cleaned up code

Code that had been extracted as a shared function was not only used once, and
the separate function did not improve readability significantly