send_message() and perform_auth() improved