should `$window` be injected and used here?