moving graph into template