refactor create Json + tests