Also, unrelatedly, refactored a filter a bit