refactored CodeGen workspace