prepare to use a packaged Stream
refactor by static code review tool