stop using int for enum, start using our own type State