extracted state transition map to separate class.