Better handling of the grants array