refactoed sortList method