possible improved event handling implementation