Factorize resource_type