Refactor some widgets and the HTML helper