more robust data extraction