Remove row sorting code to the table class itself.