removed unnecessary ref to window and document to plugin js