Optimize extract_first()