parseConfigFile was performing at a time complexity of O(n^2).
reduced time complexity to O(n).