packet-stream refactoring

little changes.