move struct stream to core.h