refactoring.

* create remote_address, local_address insted of _peer
* bug fixes