finished z3 synthesis refactoring