The most minimalistic state machine you've ever seen