refactored the predicate