typedef for state