Implement minimalistic state machine