Further refactoring; removed requirement for XHR