separate template related client logic