Finish renaming vid variable to state.