improved predicate code generation