Refactor the html helper