State handling.