Need reimplementation base on FSM.