I wonder if those in place sorting could be in a utils class I can see that being used elsewhere and the code would look simpler here?