I think you can replace the last six lines with just:

```
return this.getElementsByClassName("d-toaster-dismiss")[0];
```

or maybe better:

```
return this.querySelector(".d-toaster-dismiss");
```

But also, we usually do this by attach-points, i.e. the template would say:

```
<button data-attach-point="dismissButton">
```

and then instead of calling `this._getDismissButton()` you could just do `this.dismissButton`.