refactor linklist