Minimize number of DOM operations for performance

Optimized how the DOM is updated, and instead of manipulating the DOM for each item - through this patch - the innerHTML is constructed over the loop & is pushed to the DOM in one go.