-- cleaning the event handling code a little bit.