Factorising state name saving on main run, instead of in each controller