Designing Conversations as a State Machine