add events and preferences.