Extracted event handlers to attributes.