improved way of loading json data