Add document level processing