remove unused reference to document so you can use this lib in a worker