fix json refactor

Fixes #2