Divide client logic and user interface