@redconfetti can we remove the `$window` here?