in process of refactoring z3 generation