use macros for less code repetition
use macros for less code repetition