This function makes use of `window` so either we can keep it like this or put it in the prototype and attaching `window` to `this` so we can use it later.