Refactor form methods in the html helper