Line segment cleanup