turn the callbacks into macros

finally.