Tidy up implementation of #define based on feedback from @georgecrawford