Collector-related code shared between different collector implementations