move bufferIndex out of csv buffer
use local currentIndex cache
refactor to make better sense of it