Refactored Components' type index tracking to use a static template function