turning odd event handler into simple callback