refactored linked_list