A bunch of bond functions + clean-up work