Replace calls to the global `$core` variable with `$this->core` where possible.