Clean up UI code