basic refactoring of marctojson