Refactor HTML helper