peer stream refactoring based on new peer protocol module