look how `$window` was done above for ref