private Event parseResponse(RawSerfResponse response) throws SerfCommunicationException {

        Map<String, Value> map = (Map<String, Value>) response.getBody();

        if (map.containsKey("Event")) {
            String eventTypeString = valueConverter().asString(map.get("Event"));

            switch (eventTypeString) {
                case "user":
                    return new UserEvent(response.getSeq(), response.getError(), map);
                case "query":
                    return new QueryEvent(response.getSeq(), response.getError(), map);
                case "member-join":
                case "member-leave":
                case "member-failed":
                case "member-update":
                case "member-reap":
                    return new MembershipEvent(response.getSeq(), response.getError(), EventType.parse(eventTypeString), map);
                default:
                    throw new SerfCommunicationException("Event of type " + eventTypeString + " is not supported.");
            }
        } else {
            throw new SerfCommunicationException("EventResponse: The response did not contain the value \"Event\"");
        }
    }