added macro to reduce redundancy