added macro that eliminated duplication