Refactor client initialization to make username and password optional