move client logic into proxy module