displayList() refactoring