Refactor logic into a function predicate.