Refactored conversion from stream object to stream list which is used for the json data