Refactoring for code generation.