Add configurable sorting of roots