refactor the html input elements