Refactoring predicatebuilder