adopting _gx pattern for generated code