State handling redone.