turn the callback definitions into macros

finally.