Refactor ConfigManager