Template json: minor refactor to facilitate debug