Move method to code generator
Dopri uses new code generator method