Make onSubmit shorter by extraction functions from the onSubmit function
Make onSubmit shorter by extraction functions from the onSubmit function