private Map getPropertiesTree(Properties properties) {
		Map<String, Object> tree = new LinkedHashMap<>();
		for (String name : properties.stringPropertyNames()) {
			String[] parts = name.split("\\.");

			Map<String, Object> nextTree = tree;
			for (int i = 0, partsLength = parts.length; i < partsLength; i++) {
				String part = parts[i];
				Object value = nextTree.get(part);

				if (i < partsLength - 1) { // We must build nested tree
					if (value == null) {
						Map<String, Object> newNextTree = new LinkedHashMap<>();
						nextTree.put(part, newNextTree);
						nextTree = newNextTree;
					} else if (value instanceof Map) {
						@SuppressWarnings("unchecked")
						Map<String, Object> mapFromValue = (Map<String, Object>) value;
						nextTree = mapFromValue;
					} else {
						throw new IllegalStateException("Conversion error: key '" + name +
								"' should be instance of Map, but '" + value + "' of type '" +
								value.getClass().getName() + "' found");
					}
				} else { // We must insert value
					if (value == null) {
						nextTree.put(part, properties.getProperty(name));
					} else {
						throw new IllegalStateException("Conversion error: key '" + name +
								"' already exists with value '" + value + "' of type '" +
								value.getClass().getName() + '\'');
					}
				}
			}
		}
		return tree;
	}