Refactors the HTML class for better performance and semantics.