minor template refactoring (n: macros)