Replaced mentions of `model` with state where appropriate