Added set_macro, cleaned up template.