better setup of events