private void LoadPoolConfigs()
        {
            _logger = Log.ForContext <ConfigManager>();
            _logger.Debug("Discovering enabled pool configs..");

            var files = FileHelpers.GetFilesByExtension(PoolConfigRoot, ".json");

            foreach (var file in files)
            {
                var data = _jsonConfigReader.Read(file); // read the pool config json.

                if (data == null)                        // make sure we have loaded json data.
                {
                    continue;
                }

                // check if we have a default.json pool config.
                var filename = Path.GetFileNameWithoutExtension(file);
                if (!string.IsNullOrEmpty(filename) && filename.Equals("default", StringComparison.OrdinalIgnoreCase))
                {
                    _defaultPoolConfig = data;
                    continue; // don't add the default.json to list of pools and yet again do not load the coinconfig data for it.
                }

                if (!data.enabled) // skip pools that are not enabled.
                {
                    continue;
                }

                var coinName   = Path.GetFileNameWithoutExtension(data.coin); // get the coin-name assigned to pool.
                var coinConfig = GetCoinConfig(coinName);                     // get the coin config.

                if (coinConfig == null)                                       // make sure a configuration file for referenced coin exists.
                {
                    _logger.Error("Referenced coin configuration file coins/{0:l}.json doesn't exist, skipping pool configuration: pools/{1:l}.json", coinName, filename);
                    continue;
                }

                if (!coinConfig.Valid) // make sure the configuration for referenced coin is valid.
                {
                    _logger.Error("coins/{0:l}.json doesnt't contain a valid configuration, skipping pool configuration: pools/{1:l}.json", coinName, filename);
                    continue;
                }

                if (_defaultPoolConfig != null)                               // if we do have a default.json config
                {
                    data = JsonConfig.Merger.Merge(data, _defaultPoolConfig); // merge with it.
                }
                PoolConfigs.Add(_configFactory.GetPoolConfig(data, coinConfig));
            }

            _logger.Information("Discovered a total of {0} enabled pool configurations: {1:l}", PoolConfigs.Count,
                                PoolConfigs.Select(config => config.Coin.Name).ToList());
        }