extracted DialogState class