added template macro, etc