Replacing more $this with $cfg.