Simplify sendFormDataMessage and update tests