chore(nuve.stream): Refactor some code