Simplified the HTML at the cost of dynamically addining the CSS classes to format the chains.