Incoporated @mc10's suggestions and nitpicks. :)

Code cleanup and changed event listener from "capturing" to "bubbling" phase.