improved bolt code generation