Improved package extraction