#1 Adding more sophisticated event handling