factored out client logic from data