refactor fsm adding state notifyer and service listeners.