Refactor logic into a function predicate.

No functionality change.