Added ability to pass global config object.