Be more smarter about submitting data in XHR