State machine and state indicator