progress on logic generation refactoring