cleaned up xml parsing some more