Tidy up of state access.