Shorten some code lines
Code cleanup. Handle all XMLHttpRequest() operations in a single function.