optimized getConfigs() to avoid too many creations of LinkedHashSet and too many value copying