Nit: according to guidelines we prefer `typeof(win) == ...`