Could you do this before inserting the `li` element into its parent? It should make the function more readable (one section for modifying the content, and a final line for insertion) and it's generally a good idea to keep elements out of the DOM until we're done modifying them.