Primo: make data extraction slightly more general