refactor for loops. minified xml2json