Replace eventsMap by sync machine