Move waiting for server functionality into a private method