can we move this to `window/utils`?