add send and receive interface for client
bugfix for test dump
reduce replication code