Factor out message predicate