improved protection macros