break event handlers into individual functions