Rewrite of JSON parser