refactor predicates to lambda syntax