code generation without hack