Move ref validation to default_provider