Extract Logic updated as per latest format