refactor some xml readers