The changes to this function look pretty noisy, but the change is that the browser is now always closed(if possible) and restarted on a call to start(), so the `if thread_locals.browser is None` check is no longer necessary. That whole block was there shifted over one tab. The main change is the diff hunk that includes the "Try to clean up an existing browser session if starting a new one" comment.