More safe document integration