cleaned up the state flags wrt loading indicator, added some boilerplate to xml loader