Improve sorting of results