improve code for create linklist