optimize view on document_template