Simplfied the code in jhn_fsm.