refactor singly list