Refactored linkedlist.h