Moved createState into graph template object