refactoring removing duplicated instruction.
a little more complex xml and json