improved line splitting