Redesign to an event based handling