cleanup & depend on global/document