Remove reference to window and use jshint globals