Use macros to reduce code redundancy.