Refactor 'merge two sorted linked lists'.