minor refactoring in code_generator