separate client logic