Final changes from the state refactorings earlier