refactor the html code