Enhanced line split logic