Removed unused reference to window and document