public static Message Deserialize(String raw) {
		logger.info("deserialize '" + raw + "'");
		int typeSeperator = -1;
		typeSeperator = raw.indexOf(Message.FIELD_SEPERATOR);
		if(typeSeperator == -1) //some messages don't contain any field seperator, because they have only a type field
			typeSeperator = raw.indexOf(Message.MESSAGE_SPERATOR);
		if(typeSeperator == -1) {
			logger.warning("Can't deserialize raw message '" + raw + "'");
			return null;
		}
		
		String typeField = raw.substring(0, typeSeperator);
		switch(typeField.toUpperCase()) {
			case PeerDiscoveryMessage.TYPE_FIELD_HI:
				return DeserializePeerDiscoveryMessage(PeerDiscoveryMessage.DiscoveryMessageType.HI, raw.substring(typeSeperator + 1));
			case ByeMessage.TYPE_FIELD:
				return new ByeMessage();
			case PeerDiscoveryMessage.TYPE_FIELD_YO:
				return DeserializePeerDiscoveryMessage(PeerDiscoveryMessage.DiscoveryMessageType.YO, raw.substring(typeSeperator + 1));
			case FileAnnouncementMessage.TYPE_FIELD:
				return DeserializeFileMessage(raw.substring(typeSeperator + 1));
			case GetFileMessage.TYPE_FIELD:
				return DeserializeGetFileMessage(raw.substring(typeSeperator + 1));
			case GetFilelistMessage.TYPE_FIELD:
				return new GetFilelistMessage();
			default:
				logger.warning("I don't unterstand the following message: '" + raw + "' :(");
				return null;
		}
	}