refactor MACRO to avoid local variable name conflict; ref #2585