changed for-loop into collection stream