Cleaning up some of the ramp generation code