sorting and pageing refactoring seniors