Refactor the HTML helper