some code shuffling and cleanup in preparation to add groups and teams e2e tests.
---
#### Does this PR need a docs update or release note?
- [x] ⛔ No
#### Type of change
- [x] 🤖 Supportability/Tests
- [x] 🧹 Tech Debt/Cleanup
#### Issue(s)
* #3989
#### Test Plan
- [x] 💪 Manual
- [x] 💚 E2E