Refactored for new SQL style functions around predicates