This is probably the fastest way to get the state saved to be able to use it (but the saved data is brittle, so should be used only for testing).