Removed passing of window and document parameters.