code generation final phase modifications