replaced glib function calls to g_list_*()