Improve performance

We've made a few performance tweaks here. We've also refactored the groups dropdown significantly so it's a lot faster than it was before.