eliminated the extra json conversion, in favor of doing everything in memory