It seems like this method is only used by the Cache class, and the logic contained within applies only to the Cache class as well, so I would be in favor of putting this method back into that class directly rather than including it indirectly in an external module.

That would leave the rest of this module to deal with json data structures only, and could  be renamed to something less general such as "JsonUtils"; finally, all the methods in this module could be promoted to class level and called directly rather than including it in an object instance, e.g. ```JsonUtils::sort_json(my_json_blob)```