realize 1st variant. Work with streams