a state machine core; which can insert/remove event handle module when running