Modularise processing based on document type.