add macro to templates