Maybe this could be moved to _prepare_and_extract() for DRY.