clean up ui, history logic