Refactor the Json tools