Refactor event handling using XHR.