Client structure and login functionality