Better dialogue segmenting logic