Use a faster and safer way of flattening the form data.