added a macro to speed up performance