Packing all states into a single case class. Need to modify type checker so that types are correctly re-inferred.