Maybe rename this to just `state`? There doesn't seem much chance for confusion which state we are talking about, and it would make the code a bit cleaner.