list.next() refactoring