Slight refactoring of the event binder logic to scale better as more
types of widgets are supported.