refactor linked_list