cleaned-up code generation