added macros for templates