use macros to remove repetition