refactoring of parsePredicate