added template export functionality