Refactored jsonstring and added comments