require `document` instead of implicit global