Cleanup UI code