removing some unneeded code and streaming the submission to the server