fixed generation of root config, refactored and sorted the list