factorizing and separating the docviewer_detail.html template