Refactor clean up functions and related tests
I noticed these tests are timing out when I run them locally. I don't think adding so many users and bridges improves test coverage. While I was at it, I noticed a few optimizations for the clean up functions.