diff --git a/libbb/llist.c b/libbb/llist.c
index 7e78f7c..5ba7f60 100644
--- a/libbb/llist.c
+++ b/libbb/llist.c
@@ -25,56 +25,38 @@
 /* Add data to the end of the linked list.  */
 void FAST_FUNC llist_add_to_end(llist_t **list_head, void *data)
 {
-	llist_t *new_item = xmalloc(sizeof(llist_t));
-
-	new_item->data = data;
-	new_item->link = NULL;
-
-	if (!*list_head)
-		*list_head = new_item;
-	else {
-		llist_t *tail = *list_head;
-
-		while (tail->link)
-			tail = tail->link;
-		tail->link = new_item;
-	}
+	while (*list_head)
+		list_head = &(*list_head)->link;
+	*list_head = xzalloc(sizeof(llist_t));
+	(*list_head)->data = data;
+	/*(*list_head)->link = NULL;*/
 }
 
 /* Remove first element from the list and return it */
 void* FAST_FUNC llist_pop(llist_t **head)
 {
-	void *data, *next;
+	void *data = NULL;
+	llist_t *temp = *head;
 
-	if (!*head)
-		return NULL;
-
-	data = (*head)->data;
-	next = (*head)->link;
-	free(*head);
-	*head = next;
-
+	if (temp) {
+		data = temp->data;
+		*head = temp->link;
+		free(temp);
+	}
 	return data;
 }
 
 /* Unlink arbitrary given element from the list */
 void FAST_FUNC llist_unlink(llist_t **head, llist_t *elm)
 {
-	llist_t *crt;
-
-	if (!(elm && *head))
+	if (!elm)
 		return;
-
-	if (elm == *head) {
-		*head = (*head)->link;
-		return;
-	}
-
-	for (crt = *head; crt; crt = crt->link) {
-		if (crt->link == elm) {
-			crt->link = elm->link;
-			return;
+	while (*head) {
+		if (*head == elm) {
+			*head = (*head)->link;
+			break;
 		}
+		head = &(*head)->link;
 	}
 }
 
