optimize toggle list renderList function