private String prepareConfigString(String configString) {

        int lastLine = 0;
        int headerLine = 0;

        String[] lines = configString.split("\n");
        StringBuilder config = new StringBuilder("");

        for (String line : lines) {

            if (line.startsWith(this.getPluginName() + "_COMMENT")) {
                String comment = "#"
                        + line.trim().substring(line.indexOf(":") + 1);

                if (comment.startsWith("# +-")) {

					/*
                     * If header line = 0 then it is header start, if it's equal
					 * to 1 it's the end of header
					 */

                    if (headerLine == 0) {
                        config.append(comment + "\n");

                        lastLine = 0;
                        headerLine = 1;

                    } else if (headerLine == 1) {
                        config.append(comment + "\n\n");

                        lastLine = 0;
                        headerLine = 0;

                    }

                } else {

					/*
					 * Last line = 0 - Comment Last line = 1 - Normal path
					 */

                    String normalComment;

                    if (comment.startsWith("# ' ")) {
                        normalComment = comment.substring(0,
                                comment.length() - 1)
                                .replaceFirst("# ' ", "# ");
                    } else {
                        normalComment = comment;
                    }

                    if (lastLine == 0) {
                        config.append(normalComment + "\n");
                    } else if (lastLine == 1) {
                        config.append("\n" + normalComment + "\n");
                    }

                    lastLine = 0;

                }

            } else {
                config.append(line + "\n");
                lastLine = 1;
            }

        }

        return config.toString();

    }