Refactor the form