Changed to use Peer class to include both of input and output stream.