Refactored some code and added an add submit button function to FormElement