Implement html fragement for new list items and clean up javascript