output can print stream
optimize stream random
refactor and fixes