Refactoring of the search.
Sorting.