Replacing $this with $cfg.