fix incoming/outgoing, clean up client logic