update creatClient method to read a bit more clearly