light refactoring of the parser + making Json object/array immutable