change pathForType with rootForType