Removes unnecessary complex code by exploiting IntervalsEndingInNode