move rest of UI code to callbacks