setting up event flow etc