transformed filter into reusable predicate