Clean up some of the UI code and remove unnecessary lines.