Handles cancellation separately in analytics and scan history reads, and centralizes scan history DTO mapping to reduce duplicated code.