Added advanced grouping of json formatting