update bond code to be more compact