Cleaning up resource names to avoid collisions in nested resources