move flows to state