More code generation refactoring.