Move json generation to new visitor