CON-1787: Change way to get next element