move graph to template