Move UI event handler into UI code