Simplify paths, reduce redundant code
JSON stuff added, not quite ready