Refactored to remove global config values