more linked list refactoring