Refactor templating mechanism

= documentType || doc.document_type.id