Refactoring: deduplicate host/path hit accumulation logic