Repository: redpen-cc/redpen
Pull request #550 (2016-02-23 09:28:41)

Fix equals(), add toString(), optimize Maven dependencies, add better support of new languages


Patch:
diff --git a/redpen-cli/pom.xml b/redpen-cli/pom.xml
index d201486a..2b5561d0 100644
--- a/redpen-cli/pom.xml
+++ b/redpen-cli/pom.xml
@@ -119,6 +119,11 @@
             <artifactId>commons-cli</artifactId>
             <version>1.2</version>
         </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+            <version>1.1.1</version>
+        </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
diff --git a/redpen-core/pom.xml b/redpen-core/pom.xml
index 12142622..a3b80fe3 100644
--- a/redpen-core/pom.xml
+++ b/redpen-core/pom.xml
@@ -167,11 +167,6 @@
             <version>4.10</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>commons-cli</groupId>
-            <artifactId>commons-cli</artifactId>
-            <version>1.2</version>
-        </dependency>
         <dependency>
             <groupId>org.json</groupId>
             <artifactId>json</artifactId>
@@ -181,13 +176,6 @@
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
             <version>1.7.6</version>
-            <scope>provided</scope>
-            <optional>true</optional>
-        </dependency>
-        <dependency>
-            <groupId>ch.qos.logback</groupId>
-            <artifactId>logback-classic</artifactId>
-            <version>1.1.1</version>
         </dependency>
         <dependency>
             <groupId>org.pegdown</groupId>
diff --git a/redpen-core/src/main/java/cc/redpen/config/Configuration.java b/redpen-core/src/main/java/cc/redpen/config/Configuration.java
index 4f8cd6ec..cdb86368 100644
--- a/redpen-core/src/main/java/cc/redpen/config/Configuration.java
+++ b/redpen-core/src/main/java/cc/redpen/config/Configuration.java
@@ -143,6 +143,23 @@ public class Configuration implements Serializable, Cloneable {
         return getKey().hashCode();
     }
 
+    @Override public String toString() {
+        return "Configuration{" +
+          "lang='" + lang + '\'' +
+          ", tokenizer=" + tokenizer +
+          ", validatorConfigs=" + validatorConfigs +
+          ", symbolTable=" + symbolTable +
+          '}';
+    }
+
+    public static ConfigurationBuilder builder() {
+        return new ConfigurationBuilder();
+    }
+
+    public static ConfigurationBuilder builder(String lang) {
+        return new ConfigurationBuilder().setLanguage(lang);
+    }
+
     /**
      * Builder class of Configuration.
      */
diff --git a/redpen-core/src/main/java/cc/redpen/config/SymbolTable.java b/redpen-core/src/main/java/cc/redpen/config/SymbolTable.java
index 5a4c0fe6..7109ae0e 100644
--- a/redpen-core/src/main/java/cc/redpen/config/SymbolTable.java
+++ b/redpen-core/src/main/java/cc/redpen/config/SymbolTable.java
@@ -171,9 +171,8 @@ public class SymbolTable implements Serializable, Cloneable {
     public String toString() {
         return "SymbolTable{" +
                 "symbolDictionary=" + symbolDictionary +
-                ", valueDictionary=" + valueDictionary +
-                ", type='" + variant + '\'' +
                 ", lang='" + lang + '\'' +
+                ", variant='" + variant + '\'' +
                 '}';
     }
 
diff --git a/redpen-core/src/main/java/cc/redpen/config/ValidatorConfiguration.java b/redpen-core/src/main/java/cc/redpen/config/ValidatorConfiguration.java
index 180f2f3c..7a24b949 100644
--- a/redpen-core/src/main/java/cc/redpen/config/ValidatorConfiguration.java
+++ b/redpen-core/src/main/java/cc/redpen/config/ValidatorConfiguration.java
@@ -104,7 +104,8 @@ public class ValidatorConfiguration implements Serializable, Cloneable {
         if (this == o) return true;
         if (!(o instanceof ValidatorConfiguration)) return false;
         ValidatorConfiguration that = (ValidatorConfiguration)o;
-        return Objects.equals(configurationName, that.configurationName);
+        return Objects.equals(configurationName, that.configurationName) &&
+               Objects.equals(attributes, that.attributes);
     }
 
     @Override public int hashCode() {
diff --git a/redpen-core/src/main/java/cc/redpen/model/Document.java b/redpen-core/src/main/java/cc/redpen/model/Document.java
index ace126de..283abce6 100644
--- a/redpen-core/src/main/java/cc/redpen/model/Document.java
+++ b/redpen-core/src/main/java/cc/redpen/model/Document.java
@@ -121,6 +121,14 @@ public class Document implements Iterable<Section>, Serializable {
                 '}';
     }
 
+    public static DocumentBuilder builder() {
+        return new DocumentBuilder();
+    }
+
+    public static DocumentBuilder builder(RedPenTokenizer tokenizer) {
+        return new DocumentBuilder(tokenizer);
+    }
+
     public static class DocumentBuilder {
         private final RedPenTokenizer tokenizer;
         boolean built = false;
diff --git a/redpen-core/src/main/java/cc/redpen/parser/LaTeXParser.java b/redpen-core/src/main/java/cc/redpen/parser/LaTeXParser.java
index 663abe81..829e1e78 100644
--- a/redpen-core/src/main/java/cc/redpen/parser/LaTeXParser.java
+++ b/redpen-core/src/main/java/cc/redpen/parser/LaTeXParser.java
@@ -46,7 +46,7 @@ class LaTeXParser extends BaseDocumentParser {
     @Override
     public Document parse(InputStream inputStream, Optional<String> fileName, SentenceExtractor sentenceExtractor, RedPenTokenizer tokenizer)
             throws RedPenException {
-        Document.DocumentBuilder documentBuilder = new Document.DocumentBuilder(tokenizer);
+        Document.DocumentBuilder documentBuilder = Document.builder(tokenizer);
         fileName.ifPresent(documentBuilder::setFileName);
 
         StringBuilder sb = new StringBuilder();
diff --git a/redpen-core/src/main/java/cc/redpen/parser/MarkdownParser.java b/redpen-core/src/main/java/cc/redpen/parser/MarkdownParser.java
index 7442e764..13742ccc 100644
--- a/redpen-core/src/main/java/cc/redpen/parser/MarkdownParser.java
+++ b/redpen-core/src/main/java/cc/redpen/parser/MarkdownParser.java
@@ -55,7 +55,7 @@ class MarkdownParser extends BaseDocumentParser {
     @Override
     public Document parse(InputStream inputStream, Optional<String> fileName, SentenceExtractor sentenceExtractor, RedPenTokenizer tokenizer)
             throws RedPenException {
-        Document.DocumentBuilder documentBuilder = new Document.DocumentBuilder(tokenizer);
+        Document.DocumentBuilder documentBuilder = Document.builder(tokenizer);
         fileName.ifPresent(documentBuilder::setFileName);
 
         StringBuilder sb = new StringBuilder();
diff --git a/redpen-core/src/main/java/cc/redpen/parser/PlainTextParser.java b/redpen-core/src/main/java/cc/redpen/parser/PlainTextParser.java
index ba7420c3..37adf59b 100644
--- a/redpen-core/src/main/java/cc/redpen/parser/PlainTextParser.java
+++ b/redpen-core/src/main/java/cc/redpen/parser/PlainTextParser.java
@@ -49,7 +49,7 @@ final public class PlainTextParser extends BaseDocumentParser implements Seriali
     @Override
     public Document parse(InputStream is, Optional<String> fileName, SentenceExtractor sentenceExtractor, RedPenTokenizer tokenizer)
             throws RedPenException {
-        Document.DocumentBuilder documentBuilder = new Document.DocumentBuilder(tokenizer);
+        Document.DocumentBuilder documentBuilder = Document.builder(tokenizer);
         fileName.ifPresent(documentBuilder::setFileName);
 
         List<Sentence> headers = new ArrayList<>();
diff --git a/redpen-core/src/main/java/cc/redpen/parser/SentenceExtractor.java b/redpen-core/src/main/java/cc/redpen/parser/SentenceExtractor.java
index 765bdca6..f7efcabb 100644
--- a/redpen-core/src/main/java/cc/redpen/parser/SentenceExtractor.java
+++ b/redpen-core/src/main/java/cc/redpen/parser/SentenceExtractor.java
@@ -56,7 +56,7 @@ public class SentenceExtractor {
      * @param fullStopList set of end of sentence characters
      */
     SentenceExtractor(char[] fullStopList) {
-        this(fullStopList, extractRightQuotations(new Configuration.ConfigurationBuilder().build().getSymbolTable()));
+        this(fullStopList, extractRightQuotations(Configuration.builder().build().getSymbolTable()));
     }
 
     /**
diff --git a/redpen-core/src/main/java/cc/redpen/parser/WikiParser.java b/redpen-core/src/main/java/cc/redpen/parser/WikiParser.java
index ca3c476e..0f47371f 100644
--- a/redpen-core/src/main/java/cc/redpen/parser/WikiParser.java
+++ b/redpen-core/src/main/java/cc/redpen/parser/WikiParser.java
@@ -94,7 +94,7 @@ class WikiParser extends BaseDocumentParser {
     @Override
     public Document parse(InputStream is, Optional<String> filename, SentenceExtractor sentenceExtractor,
                           RedPenTokenizer tokenizer) throws RedPenException{
-        Document.DocumentBuilder documentBuilder = new Document.DocumentBuilder(tokenizer);
+        Document.DocumentBuilder documentBuilder = Document.builder(tokenizer);
         filename.ifPresent(documentBuilder::setFileName);
         BufferedReader br;
 
diff --git a/redpen-core/src/main/java/cc/redpen/parser/asciidoc/AsciiDocParser.java b/redpen-core/src/main/java/cc/redpen/parser/asciidoc/AsciiDocParser.java
index acc2cde1..07cfab14 100644
--- a/redpen-core/src/main/java/cc/redpen/parser/asciidoc/AsciiDocParser.java
+++ b/redpen-core/src/main/java/cc/redpen/parser/asciidoc/AsciiDocParser.java
@@ -102,7 +102,7 @@ public class AsciiDocParser extends BaseDocumentParser {
 
     @Override
     public Document parse(InputStream inputStream, Optional<String> fileName, SentenceExtractor sentenceExtractor, RedPenTokenizer tokenizer) throws RedPenException {
-        Document.DocumentBuilder documentBuilder = new Document.DocumentBuilder(tokenizer);
+        Document.DocumentBuilder documentBuilder = Document.builder(tokenizer);
         fileName.ifPresent(documentBuilder::setFileName);
 
         Model model = new Model(sentenceExtractor);
diff --git a/redpen-core/src/main/java/cc/redpen/util/DictionaryLoader.java b/redpen-core/src/main/java/cc/redpen/util/DictionaryLoader.java
index 3b098514..4015944c 100644
--- a/redpen-core/src/main/java/cc/redpen/util/DictionaryLoader.java
+++ b/redpen-core/src/main/java/cc/redpen/util/DictionaryLoader.java
@@ -89,23 +89,19 @@ public class DictionaryLoader<E> {
      *
      * @param path           resource path
      * @param dictionaryName name of the resource
-     * @return word list
-     * @throws RedPenException when failed to load the dictionary
+     * @return word collection or empty if resource is missing
      */
-    public E loadCachedFromResource(String path, String dictionaryName) throws RedPenException {
-        E strings = resourceCache.computeIfAbsent(path, e -> {
+    public E loadCachedFromResource(String path, String dictionaryName) {
+        return resourceCache.computeIfAbsent(path, e -> {
             try {
-                return loadFromResource(path);
+                E result = loadFromResource(path);
+                LOG.info("Succeeded to load " + dictionaryName + ".");
+                return result;
             } catch (IOException ioe) {
-                LOG.error(ioe.getMessage());
-                return null;
+                LOG.error("Failed to load " + dictionaryName + ":" + path + ": " + ioe.getMessage());
+                return supplier.get();
             }
         });
-        if (strings == null) {
-            throw new RedPenException("Failed to load " + dictionaryName + ":" + path);
-        }
-        LOG.info("Succeeded to load " + dictionaryName + ".");
-        return strings;
     }
 
 
diff --git a/redpen-core/src/main/java/cc/redpen/util/SpellingUtils.java b/redpen-core/src/main/java/cc/redpen/util/SpellingUtils.java
index 59daa1a9..642246b4 100644
--- a/redpen-core/src/main/java/cc/redpen/util/SpellingUtils.java
+++ b/redpen-core/src/main/java/cc/redpen/util/SpellingUtils.java
@@ -37,14 +37,8 @@ public class SpellingUtils {
     protected static void loadDictionary(String lang) {
         if (dictionaries.get(lang) == null) {
             String defaultDictionaryFile = DEFAULT_RESOURCE_PATH + "/spellchecker-" + lang + ".dat";
-            Set<String> dictionary;
-            try {
-                dictionary = new DictionaryLoader<HashSet<String>>(
-                        HashSet::new, (set, line) -> set.add(line.toLowerCase())
-                ).loadCachedFromResource(defaultDictionaryFile, "spell dictionary");
-            } catch (Exception e) {
-                dictionary = new HashSet<>();
-            }
+            Set<String> dictionary = new DictionaryLoader<Set<String>>(HashSet::new, (set, line) -> set.add(line.toLowerCase()))
+              .loadCachedFromResource(defaultDictionaryFile, "spell dictionary");
             dictionaries.put(lang, Collections.unmodifiableSet(dictionary));
         }
     }
diff --git a/redpen-core/src/main/java/cc/redpen/validator/ValidatorFactory.java b/redpen-core/src/main/java/cc/redpen/validator/ValidatorFactory.java
index b7de637a..50dbc7bf 100644
--- a/redpen-core/src/main/java/cc/redpen/validator/ValidatorFactory.java
+++ b/redpen-core/src/main/java/cc/redpen/validator/ValidatorFactory.java
@@ -47,8 +47,7 @@ public class ValidatorFactory {
     }
 
     public static Validator getInstance(String validatorName) throws RedPenException {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration(validatorName))
                 .build();
         return getInstance(conf.getValidatorConfigs().get(0), conf.getSymbolTable());
diff --git a/redpen-core/src/main/java/cc/redpen/validator/section/WordFrequencyValidator.java b/redpen-core/src/main/java/cc/redpen/validator/section/WordFrequencyValidator.java
index 52d33aad..c019c2d6 100644
--- a/redpen-core/src/main/java/cc/redpen/validator/section/WordFrequencyValidator.java
+++ b/redpen-core/src/main/java/cc/redpen/validator/section/WordFrequencyValidator.java
@@ -63,17 +63,12 @@ public class WordFrequencyValidator extends Validator {
 
         String defaultDictionaryFile = DEFAULT_RESOURCE_PATH + "/word-frequency-" + getSymbolTable().getLang() + ".dat";
         referenceWordDeviations = new HashMap<>();
-        try {
-            referenceWordFrequencies =
-                    new DictionaryLoader<Map<String, Double>>(HashMap::new, (set, line) -> {
-                        String[] fields = line.split(" ");
-                        set.put(fields[1], Double.valueOf(fields[0]));
-                    }).loadCachedFromResource(defaultDictionaryFile, "word frequencies");
-            referenceStdDeviation = getDeviations(referenceWordFrequencies, referenceWordDeviations);
-
-        } catch (Exception ignored) {
-            referenceWordFrequencies = new HashMap<>();
-        }
+        referenceWordFrequencies =
+                new DictionaryLoader<Map<String, Double>>(HashMap::new, (set, line) -> {
+                    String[] fields = line.split(" ");
+                    set.put(fields[1], Double.valueOf(fields[0]));
+                }).loadCachedFromResource(defaultDictionaryFile, "word frequencies");
+        referenceStdDeviation = getDeviations(referenceWordFrequencies, referenceWordDeviations);
     }
 
     /**
diff --git a/redpen-core/src/main/java/cc/redpen/validator/sentence/DoubleNegativeValidator.java b/redpen-core/src/main/java/cc/redpen/validator/sentence/DoubleNegativeValidator.java
index ef17a943..f0cb21ac 100644
--- a/redpen-core/src/main/java/cc/redpen/validator/sentence/DoubleNegativeValidator.java
+++ b/redpen-core/src/main/java/cc/redpen/validator/sentence/DoubleNegativeValidator.java
@@ -25,11 +25,12 @@ import cc.redpen.validator.Validator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
 import java.util.Set;
 
+import static java.util.Arrays.asList;
+
 /**
  * Detect double negative expressions in Japanese texts.
  */
@@ -82,6 +83,6 @@ public class DoubleNegativeValidator extends Validator {
 
     @Override
     public List<String> getSupportedLanguages() {
-        return Arrays.asList(Locale.JAPANESE.getLanguage(), Locale.ENGLISH.getLanguage());
+        return asList(Locale.JAPANESE.getLanguage(), Locale.ENGLISH.getLanguage());
     }
 }
diff --git a/redpen-core/src/main/java/cc/redpen/validator/sentence/KatakanaSpellCheckValidator.java b/redpen-core/src/main/java/cc/redpen/validator/sentence/KatakanaSpellCheckValidator.java
index c6049876..72a5ed03 100644
--- a/redpen-core/src/main/java/cc/redpen/validator/sentence/KatakanaSpellCheckValidator.java
+++ b/redpen-core/src/main/java/cc/redpen/validator/sentence/KatakanaSpellCheckValidator.java
@@ -165,8 +165,7 @@ final public class KatakanaSpellCheckValidator extends Validator {
     protected void init() throws RedPenException {
         boolean disableDefault = getConfigAttributeAsBoolean("disable-default", false);
         if (!disableDefault) {
-            String defaultDictionaryFile = DEFAULT_RESOURCE_PATH
-                    + "/katakana-spellcheck.dat";
+            String defaultDictionaryFile = DEFAULT_RESOURCE_PATH + "/katakana-spellcheck.dat";
             exceptions = WORD_LIST.loadCachedFromResource(defaultDictionaryFile, "katakana word dictionary");
         }
 
diff --git a/redpen-core/src/main/java/cc/redpen/validator/sentence/StartWithCapitalLetterValidator.java b/redpen-core/src/main/java/cc/redpen/validator/sentence/StartWithCapitalLetterValidator.java
index 8a8acfb9..b8c32366 100644
--- a/redpen-core/src/main/java/cc/redpen/validator/sentence/StartWithCapitalLetterValidator.java
+++ b/redpen-core/src/main/java/cc/redpen/validator/sentence/StartWithCapitalLetterValidator.java
@@ -25,12 +25,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.io.File;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Optional;
-import java.util.Set;
+import java.util.*;
 
 /**
  * Check if the input sentence start with a capital letter.
@@ -82,9 +77,7 @@ final public class StartWithCapitalLetterValidator extends Validator {
 
     @Override
     protected void init() throws RedPenException {
-
-        String defaultDictionaryFile = DEFAULT_RESOURCE_PATH
-                + "/default-capital-case-exception-list.dat";
+        String defaultDictionaryFile = DEFAULT_RESOURCE_PATH + "/default-capital-case-exception-list.dat";
         whiteList = WORD_LIST.loadCachedFromResource(defaultDictionaryFile, "capital letter exception dictionary");
 
         Optional<String> confFile = getConfigAttribute("dict");
diff --git a/redpen-core/src/main/java/cc/redpen/validator/sentence/WeakExpressionValidator.java b/redpen-core/src/main/java/cc/redpen/validator/sentence/WeakExpressionValidator.java
index e6160e65..429b7716 100644
--- a/redpen-core/src/main/java/cc/redpen/validator/sentence/WeakExpressionValidator.java
+++ b/redpen-core/src/main/java/cc/redpen/validator/sentence/WeakExpressionValidator.java
@@ -43,15 +43,8 @@ public class WeakExpressionValidator extends Validator {
         super.init();
 
         String defaultDictionaryFile = DEFAULT_RESOURCE_PATH + "/weak-expressions-" + getSymbolTable().getLang() + ".dat";
-        try {
-            weakExpressions =
-                    new DictionaryLoader<List<String>>(ArrayList::new, (list, line) -> {
-                        list.add(line.trim().toLowerCase());
-                    }).loadCachedFromResource(defaultDictionaryFile, "weak expressions");
-
-        } catch (Exception ignored) {
-            weakExpressions = new ArrayList<>();
-        }
+        weakExpressions = new DictionaryLoader<List<String>>(ArrayList::new, (list, line) -> list.add(line.trim().toLowerCase()))
+          .loadCachedFromResource(defaultDictionaryFile, "weak expressions");
     }
 
     /**
diff --git a/redpen-server/src/main/java/cc/redpen/server/api/RedPenService.java b/redpen-server/src/main/java/cc/redpen/server/api/RedPenService.java
index d666b0db..02f4914d 100644
--- a/redpen-server/src/main/java/cc/redpen/server/api/RedPenService.java
+++ b/redpen-server/src/main/java/cc/redpen/server/api/RedPenService.java
@@ -108,8 +108,7 @@ public class RedPenService {
      * @return a configured redpen instance
      */
     public RedPen getRedPen(String lang, Map<String, Map<String, String>> validatorProperties) {
-
-        Configuration.ConfigurationBuilder configBuilder = new Configuration.ConfigurationBuilder();
+        Configuration.ConfigurationBuilder configBuilder = Configuration.builder();
         configBuilder.setLanguage(lang);
 
         // add the validators and their properties


Test patch:
diff --git a/redpen-core/src/test/java/cc/redpen/AsciiDocParserTest.java b/redpen-core/src/test/java/cc/redpen/AsciiDocParserTest.java
index 739bdd83..d124127d 100644
--- a/redpen-core/src/test/java/cc/redpen/AsciiDocParserTest.java
+++ b/redpen-core/src/test/java/cc/redpen/AsciiDocParserTest.java
@@ -46,7 +46,7 @@ public class AsciiDocParserTest {
 
     @Test(expected = NullPointerException.class)
     public void testNullDocument() throws Exception {
-        Configuration configuration = new Configuration.ConfigurationBuilder().build();
+        Configuration configuration = Configuration.builder().build();
         DocumentParser parser = DocumentParser.ASCIIDOC;
         InputStream is = null;
         parser.parse(is, new SentenceExtractor(configuration.getSymbolTable()), configuration.getTokenizer());
@@ -130,7 +130,7 @@ public class AsciiDocParserTest {
         assertEquals(2, firstSection.getNumberOfParagraphs());
         assertEquals(0, firstSection.getNumberOfSubsections());
 
-        Configuration configuration = new Configuration.ConfigurationBuilder()
+        Configuration configuration = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("Spelling"))
                 .addValidatorConfig(new ValidatorConfiguration("InvalidSymbol")).build();
 
@@ -435,7 +435,7 @@ public class AsciiDocParserTest {
         Document doc = null;
         try {
             InputStream in = new FileInputStream(this.getClass().getClassLoader().getResource("asciidoc/" + filename).getFile());
-            Configuration configuration = new Configuration.ConfigurationBuilder().setLanguage(lang).build();
+            Configuration configuration = Configuration.builder().setLanguage(lang).build();
             doc = parser.parse(
                     in,
                     new SentenceExtractor(configuration.getSymbolTable()),
@@ -464,7 +464,7 @@ public class AsciiDocParserTest {
         DocumentParser parser = DocumentParser.ASCIIDOC;
         Document doc = null;
         try {
-            Configuration configuration = new Configuration.ConfigurationBuilder().build();
+            Configuration configuration = Configuration.builder().build();
             doc = parser.parse(
                     inputDocumentString,
                     new SentenceExtractor(configuration.getSymbolTable()),
diff --git a/redpen-core/src/test/java/cc/redpen/LaTeXParserTest.java b/redpen-core/src/test/java/cc/redpen/LaTeXParserTest.java
index e9a389f8..cd5834f2 100644
--- a/redpen-core/src/test/java/cc/redpen/LaTeXParserTest.java
+++ b/redpen-core/src/test/java/cc/redpen/LaTeXParserTest.java
@@ -20,13 +20,11 @@ package cc.redpen;
 import cc.redpen.config.Configuration;
 import cc.redpen.config.ValidatorConfiguration;
 import cc.redpen.model.Document;
-import cc.redpen.model.ListBlock;
 import cc.redpen.model.Paragraph;
 import cc.redpen.model.Section;
 import cc.redpen.parser.DocumentParser;
 import cc.redpen.parser.LineOffset;
 import cc.redpen.parser.SentenceExtractor;
-import cc.redpen.parser.latex.LaTeXProcessor;
 import cc.redpen.validator.ValidationError;
 import org.junit.Before;
 import org.junit.Test;
@@ -36,11 +34,8 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 
-import static cc.redpen.config.SymbolType.COMMA;
-import static cc.redpen.config.SymbolType.FULL_STOP;
-import static org.junit.Assert.*;
 import static org.junit.Assert.assertEquals;
-import static cc.redpen.parser.latex.Tools.*;
+import static org.junit.Assert.assertNotNull;
 
 public class LaTeXParserTest {
 
@@ -539,7 +534,7 @@ public class LaTeXParserTest {
             + "大きなベッドタウンであり、多くの人が住んでいる。"
             + "\\end{document}\n";
         Configuration config =
-                new Configuration.ConfigurationBuilder().setLanguage("ja").build();
+                Configuration.builder("ja").build();
         Document doc = createFileContent(sampleText, config);
 
         Section firstSections = doc.getSection(0);
@@ -557,15 +552,12 @@ public class LaTeXParserTest {
             + "\\begin{document}\n"
             + "This is a good day。\n" // invalid end of sentence symbol
             + "\\end{document}\n";
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
-                .build();
+        Configuration conf = Configuration.builder().build();
         List<Document> documents = new ArrayList<>();
         documents.add(createFileContent(sampleText, conf));
 
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("InvalidSymbol"))
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("InvalidSymbol"))
                 .build();
 
         RedPen redPen = new RedPen(configuration);
@@ -588,7 +580,7 @@ public class LaTeXParserTest {
     }
 
     private Document createFileContent(String inputDocumentString) {
-        Configuration conf = new Configuration.ConfigurationBuilder().build();
+        Configuration conf = Configuration.builder().build();
         DocumentParser parser = DocumentParser.LATEX;
         Document doc = null;
         try {
diff --git a/redpen-core/src/test/java/cc/redpen/MarkdownParserTest.java b/redpen-core/src/test/java/cc/redpen/MarkdownParserTest.java
index 93572dd9..cb22eb83 100644
--- a/redpen-core/src/test/java/cc/redpen/MarkdownParserTest.java
+++ b/redpen-core/src/test/java/cc/redpen/MarkdownParserTest.java
@@ -39,7 +39,6 @@ import java.util.List;
 import static cc.redpen.config.SymbolType.COMMA;
 import static cc.redpen.config.SymbolType.FULL_STOP;
 import static org.junit.Assert.*;
-import static org.junit.Assert.assertEquals;
 
 public class MarkdownParserTest {
 
@@ -49,7 +48,7 @@ public class MarkdownParserTest {
 
     @Test(expected = NullPointerException.class)
     public void testNullDocument() throws Exception {
-        Configuration configuration = new Configuration.ConfigurationBuilder().build();
+        Configuration configuration = Configuration.builder().build();
         DocumentParser parser = DocumentParser.MARKDOWN;
         InputStream is = null;
         parser.parse(is, new SentenceExtractor(configuration.getSymbolTable()), configuration.getTokenizer());
@@ -815,7 +814,7 @@ public class MarkdownParserTest {
         sampleText += "わたしもお寿司が大好きです。\n";
         sampleText += "\n";
 
-        Document doc = createFileContent(sampleText, new Configuration.ConfigurationBuilder().setLanguage("ja").build());
+        Document doc = createFileContent(sampleText, Configuration.builder("ja").build());
 
         assertNotNull("doc is null", doc);
         assertEquals(2, doc.size());
@@ -844,8 +843,7 @@ public class MarkdownParserTest {
     public void testGenerateJapaneseDocument() {
         String sampleText = "埼玉は東京の北に存在する。";
         sampleText += "大きなベッドタウンであり、多くの人が住んでいる。";
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("ja").build();
+        Configuration conf = Configuration.builder("ja").build();
 
         Document doc = createFileContent(sampleText, conf);
         Section firstSections = doc.getSection(0);
@@ -857,8 +855,7 @@ public class MarkdownParserTest {
     public void testGenerateJapaneseWithMultipleSentencesInOneLine() {
         String sampleText = "それは異なる．たとえば，\\n" +
                 "以下のとおりである．";
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("ja")
+        Configuration conf = Configuration.builder("ja")
                 .addSymbol(new Symbol(FULL_STOP, '．', "."))
                 .addSymbol(new Symbol(COMMA, '，', "、"))
                 .build();
@@ -877,15 +874,12 @@ public class MarkdownParserTest {
     @Test
     public void testErrorPositionOfMarkdownParser() throws RedPenException {
         String sampleText = "This is a good day。\n"; // invalid end of sentence symbol
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
-                .build();
+        Configuration conf = Configuration.builder().build();
         List<Document> documents = new ArrayList<>();
         documents.add(createFileContent(sampleText, conf));
 
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("InvalidSymbol"))
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("InvalidSymbol"))
                 .build();
 
         RedPen redPen = new RedPen(configuration);
@@ -900,15 +894,12 @@ public class MarkdownParserTest {
     @Test
     public void testInvalidSentenceInBlockquote() throws UnsupportedEncodingException, RedPenException {
         String sampleText = "> This is a good day。\n"; // invalid end of sentence symbol
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
-                .build();
+        Configuration conf = Configuration.builder().build();
         List<Document> documents = new ArrayList<>();
         documents.add(createFileContent(sampleText, conf));
 
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("InvalidSymbol"))
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("InvalidSymbol"))
                 .build();
         RedPen redPen = new RedPen(configuration);
         List<ValidationError> errors = redPen.validate(documents).get(documents.get(0));
@@ -931,7 +922,7 @@ public class MarkdownParserTest {
         DocumentParser parser = DocumentParser.MARKDOWN;
         Document doc = null;
         try {
-            Configuration configuration = new Configuration.ConfigurationBuilder().build();
+            Configuration configuration = Configuration.builder().build();
             doc = parser.parse(inputDocumentString, new SentenceExtractor(configuration.getSymbolTable()),
                     configuration.getTokenizer());
         } catch (RedPenException e) {
diff --git a/redpen-core/src/test/java/cc/redpen/PlainTextParserTest.java b/redpen-core/src/test/java/cc/redpen/PlainTextParserTest.java
index d7b489dd..11da8dac 100644
--- a/redpen-core/src/test/java/cc/redpen/PlainTextParserTest.java
+++ b/redpen-core/src/test/java/cc/redpen/PlainTextParserTest.java
@@ -65,7 +65,7 @@ public class PlainTextParserTest {
 
     private Document generateDocument(String sampleText, String lang) {
         Document doc = null;
-        Configuration configuration = new Configuration.ConfigurationBuilder().setLanguage(lang).build();
+        Configuration configuration = Configuration.builder().setLanguage(lang).build();
 
         try {
             doc = parser.parse(sampleText, new SentenceExtractor(configuration.getSymbolTable()), configuration.getTokenizer());
@@ -77,10 +77,6 @@ public class PlainTextParserTest {
 
     @Before
     public void setup() {
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("SentenceLength").addAttribute("max_length", "10"))
-                .build();
         parser = DocumentParser.PLAIN;
     }
 
@@ -325,18 +321,15 @@ public class PlainTextParserTest {
     @Test
     public void testErrorPositionOfPlainTextParser() throws RedPenException {
         String sampleText = "This is a good day。\n"; // invalid end of sentence symbol
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
-                .build();
+        Configuration conf = Configuration.builder().build();
         List<Document> documents = new ArrayList<>();
 
         DocumentParser parser = DocumentParser.PLAIN;
         Document doc = parser.parse(sampleText, new SentenceExtractor(conf.getSymbolTable()), conf.getTokenizer());
         documents.add(doc);
 
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("InvalidSymbol"))
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("InvalidSymbol"))
                 .build();
 
         RedPen redPen = new RedPen(configuration);
diff --git a/redpen-core/src/test/java/cc/redpen/RedPenTest.java b/redpen-core/src/test/java/cc/redpen/RedPenTest.java
index 6616ec27..e33b59ec 100644
--- a/redpen-core/src/test/java/cc/redpen/RedPenTest.java
+++ b/redpen-core/src/test/java/cc/redpen/RedPenTest.java
@@ -46,7 +46,7 @@ public class RedPenTest {
     public void testEmptyValidator() throws RedPenException {
 
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder()
+        documents.add(Document.builder()
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("In a land far away, there once was as a hungry programmer.", 1))
@@ -57,7 +57,7 @@ public class RedPenTest {
                 .addSentence(new Sentence("One day while programming, he got a new idea.", 4))
                 .build());
 
-        Configuration configuration = new Configuration.ConfigurationBuilder().build();
+        Configuration configuration = Configuration.builder().build();
         RedPen redPen = new RedPen(configuration);
         Map<Document, List<ValidationError>> errors = redPen.validate(documents);
         Assert.assertEquals(0, errors.get(documents.get(0)).size());
@@ -68,7 +68,7 @@ public class RedPenTest {
     public void testSentenceValidatorWithSimpleDocument()
             throws RedPenException {
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder()
+        documents.add(Document.builder()
                 .setFileName("tested file")
                 .addSection(0)
                 .addParagraph()
@@ -94,7 +94,7 @@ public class RedPenTest {
             throws RedPenException {
         List<Document> documents = new ArrayList<>();
 
-        documents.add(new Document.DocumentBuilder()
+        documents.add(Document.builder()
                 .setFileName("tested file")
                 .addSection(0)
                 .addSectionHeader("foobar")
@@ -118,7 +118,7 @@ public class RedPenTest {
     @Test
     public void testDocumentWithHeader() throws RedPenException {
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder()
+        documents.add(Document.builder()
                 .setFileName("tested file")
                 .addSection(0)
                 .addSectionHeader("this is it.")
@@ -142,7 +142,7 @@ public class RedPenTest {
     @Test
     public void testDocumentWithList() throws RedPenException {
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder()
+        documents.add(Document.builder()
                 .setFileName("tested file")
                 .addSection(0)
                 .addSectionHeader("this is it")
@@ -168,7 +168,7 @@ public class RedPenTest {
     @Test
     public void testDocumentWithoutContent() throws RedPenException {
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder()
+        documents.add(Document.builder()
                 .setFileName("tested file")
                 .build());
 
@@ -183,18 +183,16 @@ public class RedPenTest {
     private RedPen getRedPenWithSentenceValidator() throws
             RedPenException {
 
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("SentenceLength").addAttribute("max_len", "5"))
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("SentenceLength").addAttribute("max_len", "5"))
                 .build();
         return new RedPen(configuration);
     }
 
     private RedPen getRedPenWithSectionValidator() throws
             RedPenException {
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("SectionLength").addAttribute("max_num", "5"))
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("SectionLength").addAttribute("max_num", "5"))
                 .build();
         return new RedPen(configuration);
     }
diff --git a/redpen-core/src/test/java/cc/redpen/SampleDocumentGenerator.java b/redpen-core/src/test/java/cc/redpen/SampleDocumentGenerator.java
index 86332b32..5687942e 100644
--- a/redpen-core/src/test/java/cc/redpen/SampleDocumentGenerator.java
+++ b/redpen-core/src/test/java/cc/redpen/SampleDocumentGenerator.java
@@ -40,10 +40,8 @@ public class SampleDocumentGenerator {
      * @param parser    document syntax: wiki, markdown or plain
      * @return DocumentCollection object
      */
-    public static List<Document> generateOneFileDocument(String docString,
-                                                             DocumentParser parser) throws RedPenException {
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .setLanguage("en").build();
+    public static List<Document> generateOneFileDocument(String docString, DocumentParser parser) throws RedPenException {
+        Configuration configuration = Configuration.builder().build();
         List<Document> docs = new ArrayList<>();
         docs.add(parser.parse(docString, new SentenceExtractor(configuration.getSymbolTable()), configuration.getTokenizer()));
         return docs;
diff --git a/redpen-core/src/test/java/cc/redpen/WikiParserTest.java b/redpen-core/src/test/java/cc/redpen/WikiParserTest.java
index d33e4d88..22c9f27b 100644
--- a/redpen-core/src/test/java/cc/redpen/WikiParserTest.java
+++ b/redpen-core/src/test/java/cc/redpen/WikiParserTest.java
@@ -591,8 +591,7 @@ public class WikiParserTest {
         String sampleText = "埼玉は東京の北に存在する。";
         sampleText += "大きなベッドタウンであり、多くの人が住んでいる。";
 
-        Configuration config =
-                new Configuration.ConfigurationBuilder().setLanguage("ja").build();
+        Configuration config = Configuration.builder("ja").build();
         Document doc = createFileContent(sampleText, config);
 
         Section firstSections = doc.getSection(0);
@@ -603,15 +602,12 @@ public class WikiParserTest {
     @Test
     public void testErrorPositionOfMarkdownParser() throws RedPenException {
         String sampleText = "This is a good day。\n"; // invalid end of sentence symbol
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
-                .build();
+        Configuration conf = Configuration.builder().build();
         List<Document> documents = new ArrayList<>();
         documents.add(createFileContent(sampleText, conf));
 
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("InvalidSymbol"))
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("InvalidSymbol"))
                 .build();
 
         RedPen redPen = new RedPen(configuration);
@@ -634,7 +630,7 @@ public class WikiParserTest {
     }
 
     private Document createFileContent(String inputDocumentString) {
-        Configuration conf = new Configuration.ConfigurationBuilder().build();
+        Configuration conf = Configuration.builder().build();
         DocumentParser parser = DocumentParser.WIKI;
         Document doc = null;
         try {
diff --git a/redpen-core/src/test/java/cc/redpen/config/ConfigurationExporterTest.java b/redpen-core/src/test/java/cc/redpen/config/ConfigurationExporterTest.java
index efcdf998..7c561d2e 100644
--- a/redpen-core/src/test/java/cc/redpen/config/ConfigurationExporterTest.java
+++ b/redpen-core/src/test/java/cc/redpen/config/ConfigurationExporterTest.java
@@ -20,21 +20,21 @@ public class ConfigurationExporterTest {
 
   @Test
   public void emptyConfig() throws Exception {
-    Configuration config = new Configuration.ConfigurationBuilder().build();
+    Configuration config = Configuration.builder().build();
     exporter.export(config, out);
     assertEquals("<redpen-conf lang=\"en\">\n</redpen-conf>", out.toString());
   }
 
   @Test
   public void emptyConfigForJapaneseLanguage() throws Exception {
-    Configuration config = new Configuration.ConfigurationBuilder().setLanguage("ja").build();
+    Configuration config = Configuration.builder("ja").build();
     exporter.export(config, out);
     assertEquals("<redpen-conf lang=\"ja\" variant=\"zenkaku\">\n</redpen-conf>", out.toString());
   }
 
   @Test
   public void validators() throws Exception {
-    Configuration config = new Configuration.ConfigurationBuilder()
+    Configuration config = Configuration.builder()
       .addValidatorConfig(new ValidatorConfiguration("Mega"))
       .addValidatorConfig(new ValidatorConfiguration("Super").addAttribute("hello", "world")).build();
     exporter.export(config, out);
@@ -51,7 +51,7 @@ public class ConfigurationExporterTest {
 
   @Test
   public void symbols() throws Exception {
-    Configuration config = new Configuration.ConfigurationBuilder()
+    Configuration config = Configuration.builder()
       .addSymbol(new Symbol(ASTERISK, 'X'))
       .addSymbol(new Symbol(COLON, ';', ":", false, true))
       .addSymbol(new Symbol(SEMICOLON, ':', ";&", true, false)).build();
diff --git a/redpen-core/src/test/java/cc/redpen/config/ConfigurationRedPenBuilderTest.java b/redpen-core/src/test/java/cc/redpen/config/ConfigurationRedPenBuilderTest.java
index c6f082f7..bf72e5a0 100644
--- a/redpen-core/src/test/java/cc/redpen/config/ConfigurationRedPenBuilderTest.java
+++ b/redpen-core/src/test/java/cc/redpen/config/ConfigurationRedPenBuilderTest.java
@@ -28,10 +28,10 @@ import static org.junit.Assert.*;
 public class ConfigurationRedPenBuilderTest {
     @Test
     public void testBuildSimpleConfiguration() {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression"))
                 .addValidatorConfig(new ValidatorConfiguration("SentenceLength"))
-                .setLanguage("en").build();
+                .build();
 
         assertEquals(2, config.getValidatorConfigs().size());
         assertNotNull(config.getSymbolTable());
@@ -43,7 +43,7 @@ public class ConfigurationRedPenBuilderTest {
 
     @Test
     public void testBuildConfigurationWithoutSymbolTable() {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression"))
                 .addValidatorConfig(new ValidatorConfiguration("SentenceLength")).build();
 
@@ -57,7 +57,7 @@ public class ConfigurationRedPenBuilderTest {
 
     @Test
     public void testBuildConfigurationAddingProperties() {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression")
                         .addAttribute("dict", "./foobar.dict"))
                 .addValidatorConfig(new ValidatorConfiguration("SentenceLength")
@@ -77,9 +77,8 @@ public class ConfigurationRedPenBuilderTest {
 
     @Test
     public void testBuildConfigurationSpecifyingLanguage() {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression"))
-                .setLanguage("ja")
                 .build();
 
         assertNotNull(config.getSymbolTable());
@@ -89,9 +88,8 @@ public class ConfigurationRedPenBuilderTest {
 
     @Test
     public void testBuildConfigurationSpecifyingLanguageAndType() {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression"))
-                .setLanguage("ja")
                 .setVariant("hankaku")
                 .build();
 
@@ -102,9 +100,8 @@ public class ConfigurationRedPenBuilderTest {
 
     @Test
     public void testBuildConfigurationOverrideSymbolSetting() {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression"))
-                .setLanguage("ja")
                 .addSymbol(new Symbol(FULL_STOP, '.'))
                 .build();
 
@@ -115,9 +112,8 @@ public class ConfigurationRedPenBuilderTest {
 
     @Test
     public void testBuildConfigurationOverrideAddInvalidSymbolSetting() {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression"))
-                .setLanguage("ja")
                 .addSymbol(new Symbol(SymbolType.FULL_STOP, '。', ".．●"))
                 .build();
 
@@ -130,9 +126,8 @@ public class ConfigurationRedPenBuilderTest {
 
     @Test
     public void testBuildConfigurationAccessingSymbolByValue() {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression"))
-                .setLanguage("ja")
                 .addSymbol(new Symbol(SymbolType.FULL_STOP, '。', ".．●"))
                 .build();
 
@@ -147,9 +142,8 @@ public class ConfigurationRedPenBuilderTest {
     }
 
     @Test(expected = IllegalStateException.class)
-    public void testBuildTwice(){
-        Configuration.ConfigurationBuilder builder = new Configuration.ConfigurationBuilder();
-        builder.setLanguage("en");
+    public void testBuildTwice() {
+        Configuration.ConfigurationBuilder builder = Configuration.builder();
         builder.build();
         // ConfigurationBuilder is not designed to build more than one RedPen instance
         builder.setLanguage("ja");
diff --git a/redpen-core/src/test/java/cc/redpen/config/ConfigurationTest.java b/redpen-core/src/test/java/cc/redpen/config/ConfigurationTest.java
index ec97b6dc..bfe1a2f5 100644
--- a/redpen-core/src/test/java/cc/redpen/config/ConfigurationTest.java
+++ b/redpen-core/src/test/java/cc/redpen/config/ConfigurationTest.java
@@ -36,8 +36,7 @@ public class ConfigurationTest {
 
     @Test
     public void testSentenceValidatorConfiguration() throws Exception {
-
-        Configuration configuration = new Configuration.ConfigurationBuilder()
+        Configuration configuration = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("SentenceLength"))
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression"))
                 .addValidatorConfig(new ValidatorConfiguration("SpaceBeginningOfSentence"))
@@ -57,7 +56,7 @@ public class ConfigurationTest {
         // NOTE: not throw a exception even when adding a non exist validator.
         // The errors occurs when creating the added non existing validator instance.
         try {
-            new Configuration.ConfigurationBuilder()
+            Configuration.builder()
                     .addValidatorConfig(new ValidatorConfiguration("ThereIsNoSuchValidator")).build();
         } catch (Exception e) {
             fail();
@@ -66,7 +65,7 @@ public class ConfigurationTest {
 
     @Test
     public void testSectionValidatorConfiguration() throws Exception {
-        Configuration configuration = new Configuration.ConfigurationBuilder().addValidatorConfig(new ValidatorConfiguration("SectionLength"))
+        Configuration configuration = Configuration.builder().addValidatorConfig(new ValidatorConfiguration("SectionLength"))
                 .addValidatorConfig(new ValidatorConfiguration("MaxParagraphNumber"))
                 .addValidatorConfig(new ValidatorConfiguration("ParagraphStartWith")).build();
         assertEquals(3, configuration.getValidatorConfigs().size());
@@ -74,7 +73,7 @@ public class ConfigurationTest {
 
     @Test
     public void testSymbolTableWithoutLanguageSetting() throws Exception {
-        Configuration configuration = new Configuration.ConfigurationBuilder().build(); // NOTE: load "en" setting when lang is not specified
+        Configuration configuration = Configuration.builder().build(); // NOTE: load "en" setting when lang is not specified
         assertEquals("en", configuration.getLang());
         assertNotNull(configuration.getLang());
     }
@@ -99,8 +98,7 @@ public class ConfigurationTest {
 
     @Test
     public void canBeCloned() throws Exception {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-          .setLanguage("ja")
+        Configuration conf = Configuration.builder("ja")
           .setVariant("hankaku")
           .addValidatorConfig(new ValidatorConfiguration("SentenceLength")).build();
 
@@ -119,8 +117,7 @@ public class ConfigurationTest {
 
     @Test
     public void equals() throws Exception {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-          .setLanguage("ja")
+        Configuration conf = Configuration.builder("ja")
           .setVariant("hankaku")
           .addValidatorConfig(new ValidatorConfiguration("SentenceLength")).build();
 
@@ -138,8 +135,7 @@ public class ConfigurationTest {
 
     @Test
     public void serializable() throws Exception {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-          .setLanguage("ja")
+        Configuration conf = Configuration.builder("ja")
           .setVariant("hankaku")
           .addValidatorConfig(new ValidatorConfiguration("SentenceLength")).build();
 
diff --git a/redpen-core/src/test/java/cc/redpen/config/ValidatorConfigurationTest.java b/redpen-core/src/test/java/cc/redpen/config/ValidatorConfigurationTest.java
index f5ff2d4e..729e2669 100644
--- a/redpen-core/src/test/java/cc/redpen/config/ValidatorConfigurationTest.java
+++ b/redpen-core/src/test/java/cc/redpen/config/ValidatorConfigurationTest.java
@@ -2,8 +2,7 @@ package cc.redpen.config;
 
 import org.junit.Test;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotSame;
+import static org.junit.Assert.*;
 
 public class ValidatorConfigurationTest {
 
@@ -18,4 +17,25 @@ public class ValidatorConfigurationTest {
     assertNotSame(conf.getAttributes(), clone.getAttributes());
     assertEquals(conf.getAttributes(), clone.getAttributes());
   }
+
+  @Test
+  public void equals() throws Exception {
+    ValidatorConfiguration conf = new ValidatorConfiguration("test").addAttribute("foo", "bar");
+    ValidatorConfiguration conf2 = new ValidatorConfiguration("test").addAttribute("foo", "bar");
+    assertEquals(conf, conf2);
+  }
+
+  @Test
+  public void equals_attributes() throws Exception {
+    ValidatorConfiguration conf = new ValidatorConfiguration("test").addAttribute("foo", "bar");
+    ValidatorConfiguration conf2 = new ValidatorConfiguration("test").addAttribute("foo", "bar2");
+    assertFalse(conf.equals(conf2));
+  }
+
+  @Test
+  public void equals_names() throws Exception {
+    ValidatorConfiguration conf = new ValidatorConfiguration("test");
+    ValidatorConfiguration conf2 = new ValidatorConfiguration("test2");
+    assertFalse(conf.equals(conf2));
+  }
 }
\ No newline at end of file
diff --git a/redpen-core/src/test/java/cc/redpen/formatter/FormatterTest.java b/redpen-core/src/test/java/cc/redpen/formatter/FormatterTest.java
index cce47d4f..dd7b7a9b 100644
--- a/redpen-core/src/test/java/cc/redpen/formatter/FormatterTest.java
+++ b/redpen-core/src/test/java/cc/redpen/formatter/FormatterTest.java
@@ -50,7 +50,7 @@ public class FormatterTest extends Validator {
         setErrorList(errors);
         addLocalizedError(new Sentence("sentence", 1));
         Map<Document, List<ValidationError>> docErrorsMap = new HashMap<>();
-        Document document = new Document.DocumentBuilder().build();
+        Document document = Document.builder().build();
         docErrorsMap.put(document, errors);
         String result = formatter.format(docErrorsMap);
         Pattern p = Pattern.compile("foobar");
diff --git a/redpen-core/src/test/java/cc/redpen/formatter/JSONBySentenceFormatterTest.java b/redpen-core/src/test/java/cc/redpen/formatter/JSONBySentenceFormatterTest.java
index 6e87cfa6..807c7be2 100644
--- a/redpen-core/src/test/java/cc/redpen/formatter/JSONBySentenceFormatterTest.java
+++ b/redpen-core/src/test/java/cc/redpen/formatter/JSONBySentenceFormatterTest.java
@@ -29,7 +29,7 @@ public class JSONBySentenceFormatterTest extends Validator {
         List<ValidationError> errors = new ArrayList<>();
         setErrorList(errors);
         addLocalizedError(new Sentence("testing JSONFormatter", 1));
-        Document document = new Document.DocumentBuilder().setFileName("docName").build();
+        Document document = Document.builder().setFileName("docName").build();
         String result = formatter.format(document, errors);
 
         JSONObject jsonObject = new JSONObject(result);
@@ -54,12 +54,9 @@ public class JSONBySentenceFormatterTest extends Validator {
     @Test
     public void testFormatErrorsFromMarkdownParser() throws RedPenException, JSONException {
         String sampleText = "This is a good day。"; // invalid end of sentence symbol
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
-                .build();
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("InvalidSymbol"))
+        Configuration conf = Configuration.builder().build();
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("InvalidSymbol"))
                 .build();
 
         List<Document> documents = new ArrayList<>();
diff --git a/redpen-core/src/test/java/cc/redpen/formatter/JSONFormatterTest.java b/redpen-core/src/test/java/cc/redpen/formatter/JSONFormatterTest.java
index de63712b..f8d2487b 100644
--- a/redpen-core/src/test/java/cc/redpen/formatter/JSONFormatterTest.java
+++ b/redpen-core/src/test/java/cc/redpen/formatter/JSONFormatterTest.java
@@ -48,7 +48,7 @@ public class JSONFormatterTest extends Validator {
         List<ValidationError> errors = new ArrayList<>();
         setErrorList(errors);
         addLocalizedError(new Sentence("testing JSONFormatter", 1));
-        Document document = new Document.DocumentBuilder().setFileName("docName").build();
+        Document document = Document.builder().setFileName("docName").build();
         String result = formatter.format(document, errors);
         JSONObject jsonObject = new JSONObject(result);
         String docName = jsonObject.getString("document");
@@ -68,7 +68,7 @@ public class JSONFormatterTest extends Validator {
         List<ValidationError> errors = new ArrayList<>();
         setErrorList(errors);
         addLocalizedError(new Sentence("testing JSONFormatter", 1));
-        Document document = new Document.DocumentBuilder().setFileName("docName").build();
+        Document document = Document.builder().setFileName("docName").build();
         Map<Document, List<ValidationError>> documentListMap = new HashMap<>();
         documentListMap.put(document, errors);
 
@@ -91,12 +91,9 @@ public class JSONFormatterTest extends Validator {
     @Test
     public void testFormatDocumentsAndErrorsWithPosition() throws RedPenException, JSONException {
         String sampleText = "This is a good day。"; // invalid end of sentence symbol
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
-                .build();
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("InvalidSymbol"))
+        Configuration conf = Configuration.builder().build();
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("InvalidSymbol"))
                 .build();
 
         List<Document> documents = new ArrayList<>();
diff --git a/redpen-core/src/test/java/cc/redpen/formatter/XMLFormatterTest.java b/redpen-core/src/test/java/cc/redpen/formatter/XMLFormatterTest.java
index 77d3b13e..feeb7add 100644
--- a/redpen-core/src/test/java/cc/redpen/formatter/XMLFormatterTest.java
+++ b/redpen-core/src/test/java/cc/redpen/formatter/XMLFormatterTest.java
@@ -103,12 +103,9 @@ public class XMLFormatterTest extends Validator {
     public void testConvertedValidationErrorWithErrorPosition() throws RedPenException {
         // TODO: shorten the procedure before getting formatter result.
         String sampleText = "This is a good day。\n"; // invalid end of sentence symbol
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
-                .build();
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("InvalidSymbol"))
+        Configuration conf = Configuration.builder().build();
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("InvalidSymbol"))
                 .build();
 
         List<cc.redpen.model.Document> documents = new ArrayList<>();
diff --git a/redpen-core/src/test/java/cc/redpen/model/DocumentCollectionTest.java b/redpen-core/src/test/java/cc/redpen/model/DocumentCollectionTest.java
index 4e59d694..18a5b4c9 100644
--- a/redpen-core/src/test/java/cc/redpen/model/DocumentCollectionTest.java
+++ b/redpen-core/src/test/java/cc/redpen/model/DocumentCollectionTest.java
@@ -29,7 +29,7 @@ public class DocumentCollectionTest {
     @Test
     public void testCreateDocumentCollection() {
         List<Document> docs = new ArrayList<>();
-        docs.add(new Document.DocumentBuilder()
+        docs.add(Document.builder()
                 .setFileName("Foobar")
                 .addSection(0)
                 .addSectionHeader("baz")
@@ -56,14 +56,14 @@ public class DocumentCollectionTest {
     @Test
     public void testDocumentCollectionWithMultipleDocument() {
         List<Document> docs = new ArrayList<>();
-        docs.add(new Document.DocumentBuilder()
+        docs.add(Document.builder()
                 .setFileName("doc1")
                 .addSection(0)
                 .addSectionHeader("sec1")
                 .addParagraph()
                 .addSentence(new Sentence("sentence00", 1))
                 .addSentence(new Sentence("sentence01", 2)).build());
-        docs.add(new Document.DocumentBuilder()
+        docs.add(Document.builder()
                 .setFileName("doc2")
                 .addSection(0)
                 .addSectionHeader("sec2")
diff --git a/redpen-core/src/test/java/cc/redpen/model/DocumentTest.java b/redpen-core/src/test/java/cc/redpen/model/DocumentTest.java
index 3d467fbd..a9ebc339 100644
--- a/redpen-core/src/test/java/cc/redpen/model/DocumentTest.java
+++ b/redpen-core/src/test/java/cc/redpen/model/DocumentTest.java
@@ -27,14 +27,14 @@ import static org.junit.Assert.assertEquals;
 public class DocumentTest {
     @Test
     public void testCreateDocument() {
-        Document doc = new Document.DocumentBuilder()
+        Document doc = Document.builder()
                         .setFileName("Foobar").build();
         assertEquals(0, doc.size());
     }
 
     @Test
     public void testCreateDocumentWithList() {
-        Document doc = new Document.DocumentBuilder()
+        Document doc = Document.builder()
                 .setFileName("Foobar")
                 .addSection(0)
                 .addSectionHeader("baz")
@@ -70,7 +70,7 @@ public class DocumentTest {
 
     @Test
     public void testSentenceIsTokenized() {
-        Document doc = new Document.DocumentBuilder()
+        Document doc = Document.builder()
                 .setFileName("foobar")
                 .addSection(0)
                 .addSectionHeader("baz")
@@ -83,7 +83,7 @@ public class DocumentTest {
 
     @Test
     public void testJapaneseSentenceIsTokenized() {
-        Document doc = new Document.DocumentBuilder(new JapaneseTokenizer())
+        Document doc = Document.builder(new JapaneseTokenizer())
                 .setFileName("今日")
                 .addSection(0)
                 .addSectionHeader("天気")
@@ -96,7 +96,7 @@ public class DocumentTest {
 
     @Test(expected = IllegalStateException.class)
     public void testCreateParagraphBeforeSection() {
-        new Document.DocumentBuilder()
+        Document.builder()
                 .setFileName("Foobar")
                 .addParagraph()
                 .addSection(0)
@@ -105,7 +105,7 @@ public class DocumentTest {
 
     @Test(expected = IllegalStateException.class)
     public void testCreateListBlockBeforeSection() {
-        new Document.DocumentBuilder()
+        Document.builder()
                 .setFileName("Foobar")
                 .addListBlock()
                 .addSection(0)
@@ -114,7 +114,7 @@ public class DocumentTest {
 
     @Test(expected = IllegalStateException.class)
     public void testCreateListElementBeforeListBlock() {
-        new Document.DocumentBuilder()
+        Document.builder()
                 .setFileName("Foobar")
                 .addListElement(0, "foo")
                 .addListBlock()
diff --git a/redpen-core/src/test/java/cc/redpen/parser/SentenceExtractorTest.java b/redpen-core/src/test/java/cc/redpen/parser/SentenceExtractorTest.java
index 3978e333..e8dffec7 100644
--- a/redpen-core/src/test/java/cc/redpen/parser/SentenceExtractorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/parser/SentenceExtractorTest.java
@@ -41,7 +41,7 @@ public class SentenceExtractorTest {
     @Test
     public void testSimple() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         final String input = "this is a pen.";
         int lastPosition = extractor.extract(input, outputPositions);
@@ -54,7 +54,7 @@ public class SentenceExtractorTest {
     @Test
     public void testMultipleSentences() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         final String input = "this is a pen. that is a paper.";
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -68,7 +68,7 @@ public class SentenceExtractorTest {
     @Test
     public void testTwoSentencesWithDifferentStopCharacters() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         final String input = "is this a pen? that is a paper.";
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -81,7 +81,7 @@ public class SentenceExtractorTest {
 
     @Test
     public void testMultipleSentencesWithoutPeriodInTheEnd() {
-        SentenceExtractor extractor = new SentenceExtractor(new Configuration.ConfigurationBuilder().build().getSymbolTable());
+        SentenceExtractor extractor = new SentenceExtractor(Configuration.builder().build().getSymbolTable());
         final String input = "this is a pen. that is a paper";
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -94,7 +94,7 @@ public class SentenceExtractorTest {
     @Test
     public void testEndWithDoubleQuotation() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         final String input = "this is a \"pen.\"";
         int lastPosition = extractor.extract(input, outputPositions);
@@ -107,7 +107,7 @@ public class SentenceExtractorTest {
     @Test
     public void testEndWithSingleQuotation() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         final String input = "this is a \'pen.\'";
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -120,7 +120,7 @@ public class SentenceExtractorTest {
     @Test
     public void testEndWithDoubleQuotationEnglishVersion() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         final String input = "this is a \"pen\".";
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -133,7 +133,7 @@ public class SentenceExtractorTest {
     @Test
     public void testEndWithSingleQuotationEnglishVersion() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         final String input = "this is a \'pen\'.";
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -146,7 +146,7 @@ public class SentenceExtractorTest {
     @Test
     public void testMultipleSentencesOneOfThemIsEndWithDoubleQuotation() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         final String input = "this is a \"pen.\" Another one is not a pen.";
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -160,7 +160,7 @@ public class SentenceExtractorTest {
     @Test
     public void testMultipleSentencesWithPartialSplit() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         final String input = "this is a pen. Another\n" + "one is not a pen.";
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -174,7 +174,7 @@ public class SentenceExtractorTest {
     @Test
     public void testMultipleSentencesWithSplitInEndOfSentence() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         final String input = "this is a pen.\nAnother one is not a pen.";
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -188,7 +188,7 @@ public class SentenceExtractorTest {
     @Test
     public void testMultipleSentencesWithPartialSentence() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         final String input = "this is a pen. Another\n";
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -288,7 +288,7 @@ public class SentenceExtractorTest {
     @Test
     public void testSentenceWithWhiteWordPosition() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         final String input = "He is a Dr. candidate.";
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -301,7 +301,7 @@ public class SentenceExtractorTest {
     @Test
     public void testMultipleSentencesWithWhiteWordPosition() {
         SentenceExtractor extractor = new SentenceExtractor
-                (new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                (Configuration.builder().build().getSymbolTable());
         final String input = "Is he a Dr. candidate? Yes, he is.";  // NOTE: white word list contains "Dr."
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -315,7 +315,7 @@ public class SentenceExtractorTest {
     @Test
     public void testVoidLine() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         final String input = "";
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -327,7 +327,7 @@ public class SentenceExtractorTest {
     @Test
     public void testJustPeriodLine() {
         SentenceExtractor extractor = new SentenceExtractor(
-                new Configuration.ConfigurationBuilder().build().getSymbolTable());
+                Configuration.builder().build().getSymbolTable());
         final String input = ".";
         List<Pair<Integer, Integer>> outputPositions = new ArrayList<>();
         int lastPosition = extractor.extract(input, outputPositions);
@@ -370,7 +370,7 @@ public class SentenceExtractorTest {
 
     @Test
     public void testThrowExceptionGivenNull() {
-        SentenceExtractor extractor = new SentenceExtractor(new Configuration.ConfigurationBuilder().build().getSymbolTable());
+        SentenceExtractor extractor = new SentenceExtractor(Configuration.builder().build().getSymbolTable());
         extractor.constructEndSentencePattern(); // not a throw exception
     }
 }
diff --git a/redpen-core/src/test/java/cc/redpen/parser/asciidoc/AsciiDocTest.java b/redpen-core/src/test/java/cc/redpen/parser/asciidoc/AsciiDocTest.java
index 004f6f26..4186a1d8 100644
--- a/redpen-core/src/test/java/cc/redpen/parser/asciidoc/AsciiDocTest.java
+++ b/redpen-core/src/test/java/cc/redpen/parser/asciidoc/AsciiDocTest.java
@@ -32,8 +32,7 @@ public class AsciiDocTest {
      */
     @Test
     public void testModelErasure() {
-
-        Configuration configuration = new Configuration.ConfigurationBuilder().build();
+        Configuration configuration = Configuration.builder().build();
 
         String asciidocText =
                 "[[purpose]]\n" +
diff --git a/redpen-core/src/test/java/cc/redpen/util/DictionaryLoaderTest.java b/redpen-core/src/test/java/cc/redpen/util/DictionaryLoaderTest.java
index 60251967..4ebf8601 100644
--- a/redpen-core/src/test/java/cc/redpen/util/DictionaryLoaderTest.java
+++ b/redpen-core/src/test/java/cc/redpen/util/DictionaryLoaderTest.java
@@ -25,13 +25,15 @@ import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
-import java.nio.file.*;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
 
 public class DictionaryLoaderTest extends Validator {
     @Test
@@ -106,18 +108,20 @@ public class DictionaryLoaderTest extends Validator {
         assertTrue(strings.contains("bar"));
     }
 
-    @Test
+    @Test(expected = RedPenException.class)
     public void testEnsureFileIsInsideRedPenHomeOrWorkingDirectory() throws RedPenException, IOException {
         File tempFile = File.createTempFile("redpenTest", "redpenTest");
         String path = tempFile.getAbsolutePath();
         System.setProperty("REDPEN_HOME", path);
         DictionaryLoader.ensureFileIsInsideRedPenHomeOrWorkingDirectory(path + File.separator + "test");
         DictionaryLoader.ensureFileIsInsideRedPenHomeOrWorkingDirectory(new File("fileInCurrentDirectory.txt").getCanonicalPath());
-        try {
-            File file = new File(path + File.separator + ".." + File.separator + "test");
-            DictionaryLoader.ensureFileIsInsideRedPenHomeOrWorkingDirectory(file.getCanonicalPath());
-            fail("expecting RedPenException");
-        } catch (RedPenException expected) {
-        }
+        File file = new File(path + File.separator + ".." + File.separator + "test");
+        DictionaryLoader.ensureFileIsInsideRedPenHomeOrWorkingDirectory(file.getCanonicalPath());
+    }
+
+    @Test
+    public void testLoadingInexistingResourceReturnsAnEmptyCollection() throws Exception {
+        Set<String> result = new DictionaryLoader<Set<String>>(HashSet::new, null).loadCachedFromResource("hello.xml", "hello");
+        assertTrue(result.isEmpty());
     }
 }
diff --git a/redpen-core/src/test/java/cc/redpen/validator/BaseValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/BaseValidatorTest.java
index 6c39d721..46cc9419 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/BaseValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/BaseValidatorTest.java
@@ -15,13 +15,13 @@ public abstract class BaseValidatorTest {
   }
 
   protected Configuration getConfiguration(String language) {
-    return new Configuration.ConfigurationBuilder()
+    return Configuration.builder()
       .addValidatorConfig(new ValidatorConfiguration(validatorName))
       .setLanguage(language).build();
   }
 
   protected Document prepareSimpleDocument(String sentrence) {
-    return new Document.DocumentBuilder(config.getTokenizer())
+    return Document.builder(config.getTokenizer())
       .addSection(1)
       .addParagraph()
       .addSentence(new Sentence(sentrence, 1))
diff --git a/redpen-core/src/test/java/cc/redpen/validator/JavaScriptValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/JavaScriptValidatorTest.java
index c2003f6a..7e120442 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/JavaScriptValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/JavaScriptValidatorTest.java
@@ -33,8 +33,6 @@ import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.List;
-import javax.script.ScriptEngine;
-import javax.script.ScriptException;
 
 import static junit.framework.Assert.assertEquals;
 
@@ -69,11 +67,11 @@ public class JavaScriptValidatorTest extends JavaScriptValidator {
         Files.write(Paths.get(validatorJS.getAbsolutePath()), content2.getBytes(Charset.forName("UTF-8")));
         validatorJS.deleteOnExit();
 
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("JavaScript").addAttribute("script-path", javaScriptValidatorsDir.getAbsolutePath()))
                 .build();
 
-        Document document = new Document.DocumentBuilder()
+        Document document = Document.builder()
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("the good item is a good example.", 1))
@@ -112,7 +110,7 @@ public class JavaScriptValidatorTest extends JavaScriptValidator {
                         "_JavaScriptValidatorTest.calledFunctions.add('validateSection');" +
                         // add ValidationError
                         "addLocalizedError(section.getHeaderContent(0), 'section');}"));
-        Document document = new Document.DocumentBuilder()
+        Document document = Document.builder()
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("the good item is a good example.", 1))
@@ -149,7 +147,7 @@ public class JavaScriptValidatorTest extends JavaScriptValidator {
                         "function validateSentence(sentence) {" +
                         // add ValidationError
                         "addLocalizedError(sentence, '[placeholder]');}"));
-        Document document = new Document.DocumentBuilder()
+        Document document = Document.builder()
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("the good item is a good example.", 1))
@@ -175,7 +173,7 @@ public class JavaScriptValidatorTest extends JavaScriptValidator {
                                          + "addLocalizedError(sentence, 'runtime environment is confined');"
                                          + "}"
                                          + "}"));
-        Document document = new Document.DocumentBuilder()
+        Document document = Document.builder()
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("the good item is a good example.", 1))
diff --git a/redpen-core/src/test/java/cc/redpen/validator/ValidatorFactoryTest.java b/redpen-core/src/test/java/cc/redpen/validator/ValidatorFactoryTest.java
index e39011f4..1b07288c 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/ValidatorFactoryTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/ValidatorFactoryTest.java
@@ -23,8 +23,6 @@ import cc.redpen.config.ValidatorConfiguration;
 import cc.redpen.model.Sentence;
 import org.junit.Test;
 
-import java.util.List;
-
 import static junit.framework.Assert.fail;
 
 class NotImplementInterfaceValidator {}
@@ -38,8 +36,7 @@ class NoConstructorWithConfigsValidator extends Validator {
 public class ValidatorFactoryTest {
     @Test
     public void testCreateValidator() {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("SentenceLength"))
                 .build();
         try {
@@ -52,8 +49,7 @@ public class ValidatorFactoryTest {
 
     @Test(expected = RedPenException.class)
     public void testThrowExceptionWhenCreateNonExistValidator() throws RedPenException {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("Foobar"))
                 .build();
         ValidatorFactory.getInstance(
@@ -62,8 +58,7 @@ public class ValidatorFactoryTest {
 
     @Test(expected = RuntimeException.class)
     public void testThrowExceptionWhenCreateValidatorNotImplementsInterface() throws RedPenException {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("NotImplementInterface"))
                 .build();
         ValidatorFactory.getInstance(
@@ -72,8 +67,7 @@ public class ValidatorFactoryTest {
 
     @Test(expected = RuntimeException.class)
     public void testThrowExceptionWhenCreateValidatorWithoutConstructorWithConfigs() throws RedPenException {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("NoConstructorWithConfigs"))
                 .build();
         ValidatorFactory.getInstance(
diff --git a/redpen-core/src/test/java/cc/redpen/validator/section/DuplicatedSectionValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/section/DuplicatedSectionValidatorTest.java
index 20f444ff..698a8f41 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/section/DuplicatedSectionValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/section/DuplicatedSectionValidatorTest.java
@@ -35,13 +35,13 @@ public class DuplicatedSectionValidatorTest {
 
     @Test
     public void testDetectDuplicatedSection() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("DuplicatedSection"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addSectionHeader("this is header")
                         .addParagraph()
@@ -57,16 +57,15 @@ public class DuplicatedSectionValidatorTest {
         Assert.assertEquals(2, errors.get(documents.get(0)).size());
     }
 
-
     @Test
     public void testDetectNonDuplicatedSection() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("DuplicatedSection"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addSectionHeader("foobar")
                         .addParagraph()
@@ -84,13 +83,13 @@ public class DuplicatedSectionValidatorTest {
 
     @Test
     public void testDetectDuplicatedSectionWithSameHeader() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("DuplicatedSection"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addSectionHeader("this is header.")
                         .addParagraph()
@@ -108,14 +107,14 @@ public class DuplicatedSectionValidatorTest {
 
     @Test
     public void testDetectNonDuplicatedSectionWithLowThreshold() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("DuplicatedSection").addAttribute("threshold", "0.0"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
         // create two section which contains only one same word, "baz"
         documents.add(
-        new Document.DocumentBuilder()
+        Document.builder()
                 .addSection(1)
                 .addSectionHeader("foobar")
                 .addParagraph()
diff --git a/redpen-core/src/test/java/cc/redpen/validator/section/FrequentSentenceStartValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/section/FrequentSentenceStartValidatorTest.java
index 60246dc2..3b7abb1c 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/section/FrequentSentenceStartValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/section/FrequentSentenceStartValidatorTest.java
@@ -37,7 +37,7 @@ public class FrequentSentenceStartValidatorTest {
         FrequentSentenceStartValidator validator = (FrequentSentenceStartValidator) ValidatorFactory.getInstance("FrequentSentenceStart");
 
         Document document =
-                new Document.DocumentBuilder(new WhiteSpaceTokenizer())
+                Document.builder(new WhiteSpaceTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("When it comes to the Subject Of Cake (the sweet and delicious baked delicacy), one should" +
diff --git a/redpen-core/src/test/java/cc/redpen/validator/section/ParagraphNumberValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/section/ParagraphNumberValidatorTest.java
index 26528812..f75e0563 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/section/ParagraphNumberValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/section/ParagraphNumberValidatorTest.java
@@ -60,7 +60,7 @@ public class ParagraphNumberValidatorTest {
         Section section = new Section(0);
         section.appendParagraph(new Paragraph());
 
-        Document document = new Document.DocumentBuilder().appendSection(section).build();
+        Document document = Document.builder().appendSection(section).build();
 
         List<ValidationError> errors = new ArrayList<>();
         validator.setErrorList(errors);
diff --git a/redpen-core/src/test/java/cc/redpen/validator/section/UnexpandedAcronymValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/section/UnexpandedAcronymValidatorTest.java
index 71fe00a3..51d9ce53 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/section/UnexpandedAcronymValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/section/UnexpandedAcronymValidatorTest.java
@@ -37,7 +37,7 @@ public class UnexpandedAcronymValidatorTest {
         UnexpandedAcronymValidator validator = (UnexpandedAcronymValidator) ValidatorFactory.getInstance("UnexpandedAcronym");
 
         Document document =
-                new Document.DocumentBuilder(new WhiteSpaceTokenizer())
+                Document.builder(new WhiteSpaceTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("When it comes to the Subject Of Cake (the sweet and delicious baked delicacy), one should" +
diff --git a/redpen-core/src/test/java/cc/redpen/validator/section/WordFrequencyValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/section/WordFrequencyValidatorTest.java
index 52cefd7a..e8fdcd48 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/section/WordFrequencyValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/section/WordFrequencyValidatorTest.java
@@ -51,7 +51,7 @@ public class WordFrequencyValidatorTest {
                 "By 1285, following a period of social and environmental instability driven by a series of severe and prolonged droughts, they abandoned the area and moved south to locations in Arizona and New Mexico, including Rio Chama, Pajarito Plateau, and Santa Fe."
         };
 
-        Document.DocumentBuilder builder = new Document.DocumentBuilder(new WhiteSpaceTokenizer()).addSection(1).addParagraph();
+        Document.DocumentBuilder builder = Document.builder(new WhiteSpaceTokenizer()).addSection(1).addParagraph();
         int sentenceNumber = 1;
         for (String line : text) {
             builder.addSentence(new Sentence(line, sentenceNumber++));
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/ContractionValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/ContractionValidatorTest.java
index 44e5080e..473c5f51 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/ContractionValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/ContractionValidatorTest.java
@@ -34,13 +34,13 @@ import java.util.Map;
 public class ContractionValidatorTest {
     @Test
     public void testContraction() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("Contraction"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("he is a super man.", 1))
@@ -55,13 +55,13 @@ public class ContractionValidatorTest {
 
     @Test
     public void testNoContraction() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("Contraction"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("he is a super man.", 1))
@@ -76,13 +76,13 @@ public class ContractionValidatorTest {
 
     @Test
     public void testUpperCaseContraction() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("Contraction"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("He is a super man.", 1))
@@ -100,13 +100,13 @@ public class ContractionValidatorTest {
      */
     @Test
     public void testManyContractions() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("Contraction"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("he's a super man.", 1))
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/DoubleNegativeValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/DoubleNegativeValidatorTest.java
index 9ed235d0..986aa8de 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/DoubleNegativeValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/DoubleNegativeValidatorTest.java
@@ -28,7 +28,6 @@ import org.junit.Test;
 
 import java.util.ArrayList;
 import java.util.List;
-
 import java.util.Map;
 
 import static junit.framework.Assert.assertEquals;
@@ -37,10 +36,8 @@ public class DoubleNegativeValidatorTest {
     @Test
     public void testDetectDoubleNegative() throws Exception {
         String sampleText = "そういう話なら、理解できないこともない。";
-        Configuration config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("DoubleNegative"))
-                .setLanguage("ja")
+        Configuration config = Configuration.builder("ja")
+                .addValidatorConfig(new ValidatorConfiguration("DoubleNegative"))
                 .build();
 
         DocumentParser parser = DocumentParser.MARKDOWN;
@@ -62,10 +59,8 @@ public class DoubleNegativeValidatorTest {
     public void testNotDetectSingleNegative() throws Exception {
         String sampleText =
                 "そういう話は理解できない。";
-        Configuration config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("DoubleNegative"))
-                .setLanguage("ja")
+        Configuration config = Configuration.builder("ja")
+                .addValidatorConfig(new ValidatorConfiguration("DoubleNegative"))
                 .build();
         DocumentParser parser = DocumentParser.MARKDOWN;
         List<Document> documents = new ArrayList<>();
@@ -84,10 +79,8 @@ public class DoubleNegativeValidatorTest {
     public void testNotDetectPositiveType() throws Exception {
         String sampleText =
                 "そういう話は理解できる。";
-        Configuration config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("DoubleNegative"))
-                .setLanguage("ja")
+        Configuration config = Configuration.builder("ja")
+                .addValidatorConfig(new ValidatorConfiguration("DoubleNegative"))
                 .build();
         DocumentParser parser = DocumentParser.MARKDOWN;
         List<Document> documents = new ArrayList<>();
@@ -105,10 +98,8 @@ public class DoubleNegativeValidatorTest {
     public void testDetectFuzzyDoubleNegative() throws Exception {
         String sampleText =
                 "そういう話なら、ないことないでしょう。";
-        Configuration config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("DoubleNegative"))
-                .setLanguage("ja")
+        Configuration config = Configuration.builder("ja")
+                .addValidatorConfig(new ValidatorConfiguration("DoubleNegative"))
                 .build();
         DocumentParser parser = DocumentParser.MARKDOWN;
         List<Document> documents = new ArrayList<>();
@@ -127,10 +118,10 @@ public class DoubleNegativeValidatorTest {
     @Test
     public void testDetectEnDoubleNegative() throws Exception {
         String sampleText = "We believe it, unless it is not true";
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(
                         new ValidatorConfiguration("DoubleNegative"))
-                .setLanguage("en")
+
                 .build();
 
         DocumentParser parser = DocumentParser.MARKDOWN;
@@ -152,10 +143,8 @@ public class DoubleNegativeValidatorTest {
     @Test
     public void testDetectEnDoubleNegativeWithDistance() throws Exception {
         String sampleText = "unless that is not true, I will go there.";
-        Configuration config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("DoubleNegative"))
-                .setLanguage("en")
+        Configuration config = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("DoubleNegative"))
                 .build();
 
         DocumentParser parser = DocumentParser.MARKDOWN;
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/DoubledJoshiValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/DoubledJoshiValidatorTest.java
index 1df7cbb2..c081b85a 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/DoubledJoshiValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/DoubledJoshiValidatorTest.java
@@ -36,15 +36,15 @@ public class DoubledJoshiValidatorTest {
     @Test
     public void testDetectDoubledJoshi() throws Exception {
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder(new JapaneseTokenizer())
+        documents.add(Document.builder(new JapaneseTokenizer())
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("私は彼は好き。", 1))
                 .build());
 
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("DoubledJoshi"))
-                .setLanguage("ja").build();
+                .build();
 
         RedPen redPen = new RedPen(config);
         Map<Document, List<ValidationError>> errors = redPen.validate(documents);
@@ -54,15 +54,15 @@ public class DoubledJoshiValidatorTest {
     @Test
     public void testNotDetectSingleJoshi() throws Exception {
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder(new JapaneseTokenizer())
+        documents.add(Document.builder(new JapaneseTokenizer())
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("私は彼が好き。", 1))
                 .build());
 
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("DoubledJoshi"))
-                .setLanguage("ja").build();
+                .build();
 
         RedPen redPen = new RedPen(config);
         Map<Document, List<ValidationError>> errors = redPen.validate(documents);
@@ -72,15 +72,15 @@ public class DoubledJoshiValidatorTest {
     @Test
     public void testLoadSkipList() throws Exception {
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder(new JapaneseTokenizer())
+        documents.add(Document.builder(new JapaneseTokenizer())
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("私は彼は好き。", 1))
                 .build());
 
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("DoubledJoshi").addAttribute("list", "は"))
-                .setLanguage("ja").build();
+                .build();
 
         RedPen redPen = new RedPen(config);
         Map<Document, List<ValidationError>> errors = redPen.validate(documents);
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/DoubledWordValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/DoubledWordValidatorTest.java
index 3da0ae82..97ccd029 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/DoubledWordValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/DoubledWordValidatorTest.java
@@ -69,10 +69,10 @@ public class DoubledWordValidatorTest extends BaseValidatorTest {
 
     @Test
     public void testDoubledUserDefinedSkipWord() throws RedPenException {
-        config = new Configuration.ConfigurationBuilder()
+        config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration(validatorName)
                         .addAttribute("list", "redpen,tool"))
-                .setLanguage("en").build();
+                .build();
 
         Document document = prepareSimpleDocument("RedPen is RedPen right?");
 
@@ -83,10 +83,9 @@ public class DoubledWordValidatorTest extends BaseValidatorTest {
 
     @Test
     public void testDoubledUserDefinedSkipWordWithoutNormalization() throws RedPenException {
-        config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(new ValidatorConfiguration(validatorName)
-                        .addAttribute("list", "RedPen,Tool"))
-                .setLanguage("en").build();
+        config = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration(validatorName).addAttribute("list", "RedPen,Tool"))
+                .build();
 
         Document document = prepareSimpleDocument("redPen is redPen right?");
 
@@ -97,9 +96,9 @@ public class DoubledWordValidatorTest extends BaseValidatorTest {
 
     @Test
     public void testDoubledWordInJapaneseSentence() throws RedPenException {
-        config = new Configuration.ConfigurationBuilder()
+        config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration(validatorName))
-                .setLanguage("ja").build();
+                .build();
 
         Document document = prepareSimpleDocument("それは真実であり，それが正しい");
 
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/EndOfSentenceValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/EndOfSentenceValidatorTest.java
index 0f55954c..a09398bc 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/EndOfSentenceValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/EndOfSentenceValidatorTest.java
@@ -76,12 +76,12 @@ public class EndOfSentenceValidatorTest {
 
     @Test
     public void testJapaneseInvalidEndOfSentence() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("EndOfSentence"))
-                .setLanguage("ja").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder(new JapaneseTokenizer())
+                Document.builder(new JapaneseTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("彼は言った，“今日は誕生日”。", 1))
@@ -95,9 +95,8 @@ public class EndOfSentenceValidatorTest {
     @Test
     public void testErrorPosition() throws RedPenException {
         String sampleText = "He said \"that is right\".";
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("EndOfSentence"))
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("EndOfSentence"))
                 .build();
         DocumentParser parser = DocumentParser.MARKDOWN;
         List<Document> documents = new ArrayList<>();
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/HyphenationValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/HyphenationValidatorTest.java
index 574bf216..26dc56e4 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/HyphenationValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/HyphenationValidatorTest.java
@@ -37,7 +37,7 @@ public class HyphenationValidatorTest {
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder(new WhiteSpaceTokenizer())
+                Document.builder(new WhiteSpaceTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("Hyphenation is very useful to stop a sentence such as bad tempered " +
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/InvalidExpressionValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/InvalidExpressionValidatorTest.java
index 306467b9..6fd7967e 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/InvalidExpressionValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/InvalidExpressionValidatorTest.java
@@ -43,9 +43,9 @@ public class InvalidExpressionValidatorTest {
 
     @Test
     public void testSimpleRun() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression").addAttribute("list", "may"))
-                .setLanguage("en").build();
+                .build();
         Validator validator = ValidatorFactory.getInstance(config.getValidatorConfigs().get(0), config.getSymbolTable());
         List<ValidationError> errors = new ArrayList<>();
         validator.setErrorList(errors);
@@ -55,9 +55,9 @@ public class InvalidExpressionValidatorTest {
 
     @Test
     public void testVoid() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression").addAttribute("list", "may"))
-                .setLanguage("en").build();
+                .build();
         Validator validator = ValidatorFactory.getInstance(config.getValidatorConfigs().get(0), config.getSymbolTable());
         List<ValidationError> errors = new ArrayList<>();
         validator.setErrorList(errors);
@@ -67,12 +67,12 @@ public class InvalidExpressionValidatorTest {
 
     @Test
     public void testLoadDefaultDictionary() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("You know. He is a super man.", 1))
@@ -85,12 +85,12 @@ public class InvalidExpressionValidatorTest {
 
     @Test
     public void testLoadJapaneseDefaultDictionary() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression"))
-                .setLanguage("ja").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder(new JapaneseTokenizer())
+                Document.builder(new JapaneseTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("明日地球が滅亡するってマジですか。", 1))
@@ -104,12 +104,12 @@ public class InvalidExpressionValidatorTest {
 
     @Test
     public void testLoadJapaneseInvalidList() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("InvalidExpression").addAttribute("list", "うふぉ,ガチ"))
-                .setLanguage("ja").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder(new JapaneseTokenizer())
+                Document.builder(new JapaneseTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("うふぉっ本当ですか？", 1))
@@ -123,9 +123,8 @@ public class InvalidExpressionValidatorTest {
     @Test
     public void testErrorPosition() throws RedPenException {
         String sampleText = "Hello You know."; // invalid expression "You know"
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("InvalidExpression"))
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("InvalidExpression"))
                 .build();
         DocumentParser parser = DocumentParser.MARKDOWN;
         List<Document> documents = new ArrayList<>();
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/InvalidSymbolValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/InvalidSymbolValidatorTest.java
index 9f36a62e..e1748a64 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/InvalidSymbolValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/InvalidSymbolValidatorTest.java
@@ -44,15 +44,14 @@ public class InvalidSymbolValidatorTest {
     public void testWithInvalidSymbol() throws RedPenException {
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder(new JapaneseTokenizer())
+                Document.builder(new JapaneseTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("わたしはカラオケが大好き！", 1))
                         .build());
 
-        Configuration conf = new Configuration.ConfigurationBuilder()
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("InvalidSymbol"))
-                .setLanguage("en")
                 .addSymbol(new Symbol(EXCLAMATION_MARK, '!', "！"))
                 .build();
 
@@ -67,15 +66,14 @@ public class InvalidSymbolValidatorTest {
     public void testWithoutInvalidSymbol() throws RedPenException {
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("I like Karaoke", 1))
                         .build());
 
-        Configuration conf = new Configuration.ConfigurationBuilder()
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("InvalidSymbol"))
-                .setLanguage("en")
                 .addSymbol(new Symbol(EXCLAMATION_MARK, '!', "！"))
                 .build();
 
@@ -89,15 +87,14 @@ public class InvalidSymbolValidatorTest {
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("わたしは、カラオケが大好き！", 1)) // NOTE: two invalid symbols
                         .build());
 
-        Configuration conf = new Configuration.ConfigurationBuilder()
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("InvalidSymbol"))
-                .setLanguage("en")
                 .addSymbol(new Symbol(EXCLAMATION_MARK, '!', "！"))
                 .addSymbol(new Symbol(COMMA, ',', "、"))
                 .build();
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/InvalidWordValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/InvalidWordValidatorTest.java
index 41d5ac9e..d1ca3f9b 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/InvalidWordValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/InvalidWordValidatorTest.java
@@ -42,15 +42,15 @@ public class InvalidWordValidatorTest {
     @Test
     public void testSimpleRun() throws RedPenException {
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("He is a foolish guy.", 1))
                         .build());
 
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("InvalidWord").addAttribute("list", "foolish"))
-                .setLanguage("en").build();
+                .build();
         Validator validator = ValidatorFactory.getInstance(config.getValidatorConfigs().get(0), config.getSymbolTable());
 
         List<ValidationError> errors = new ArrayList<>();
@@ -62,15 +62,15 @@ public class InvalidWordValidatorTest {
     @Test
     public void testVoid() throws RedPenException {
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("", 1))
                         .build());
 
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("InvalidWord").addAttribute("list", "foolish"))
-                .setLanguage("en").build();
+                .build();
         Validator validator = ValidatorFactory.getInstance(config.getValidatorConfigs().get(0), config.getSymbolTable());
         List<ValidationError> errors = new ArrayList<>();
         validator.setErrorList(errors);
@@ -80,12 +80,12 @@ public class InvalidWordValidatorTest {
 
     @Test
     public void testLoadDefaultDictionary() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("InvalidWord"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("he is a foolish man.", 1))
@@ -100,12 +100,12 @@ public class InvalidWordValidatorTest {
 
     @Test
     public void testLoadUserDictionary() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("InvalidWord").addAttribute("list", "boom,domo"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("Domo is a greeting word in Japan.", 1))
@@ -113,20 +113,20 @@ public class InvalidWordValidatorTest {
 
         RedPen redPen = new RedPen(config);
         Map<Document, List<ValidationError>> errors = redPen.validate(documents);
-        Assert.assertEquals(1, errors.get(documents.get(0)).size());
+        assertEquals(1, errors.get(documents.get(0)).size());
     }
 
     /**
      * Assert not throw a exception even when there is no default dictionary.
      */
-    @Test(expected = RedPenException.class)
-    public void testLoadNotExistDefaultDictionary() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+    @Test
+    public void testLoadNotExistingDefaultDictionary() throws RedPenException {
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("InvalidWord"))
-                .setLanguage("ja").build(); // NOTE: no dictionary for japanese or other languages whose words are not split by white space.
+                .build(); // NOTE: no dictionary for japanese or other languages whose words are not split by white space.
 
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder(new JapaneseTokenizer())
+                Document.builder(new JapaneseTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("こんにちは、群馬にきました。", 1))
@@ -134,6 +134,6 @@ public class InvalidWordValidatorTest {
 
         RedPen redPen = new RedPen(config);
         Map<Document, List<ValidationError>> errors = redPen.validate(documents);
-        Assert.assertEquals(0, errors.get(documents.get(0)).size());
+        assertEquals(0, errors.get(documents.get(0)).size());
     }
 }
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/JapaneseStyleValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/JapaneseStyleValidatorTest.java
index 7b47495f..0e404e23 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/JapaneseStyleValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/JapaneseStyleValidatorTest.java
@@ -41,10 +41,8 @@ public class JapaneseStyleValidatorTest {
                 "今日はいい天気ですね。\n" +
                 "昨日は雨だったのだが、持ち直した。\n" +
                 "明日もいい天気だといいですね。";
-        Configuration config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("JapaneseStyle"))
-                .setLanguage("ja")
+        Configuration config = Configuration.builder("ja")
+                .addValidatorConfig(new ValidatorConfiguration("JapaneseStyle"))
                 .build();
         DocumentParser parser = DocumentParser.MARKDOWN;
         List<Document> documents = new ArrayList<>();
@@ -64,13 +62,13 @@ public class JapaneseStyleValidatorTest {
 
     @Test
     public void desuMasuStyle() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("JapaneseStyle"))
-                .setLanguage("ja").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder(new JapaneseTokenizer())
+                Document.builder(new JapaneseTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("今日はいい天気ですね。", 1))
@@ -85,13 +83,13 @@ public class JapaneseStyleValidatorTest {
 
     @Test
     public void dearuStyle() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("JapaneseStyle"))
-                .setLanguage("ja").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder(new JapaneseTokenizer())
+                Document.builder(new JapaneseTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("今日はいい天気である。", 1))
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/KatakanaEndHyphenValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/KatakanaEndHyphenValidatorTest.java
index c4255a56..aef1cc08 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/KatakanaEndHyphenValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/KatakanaEndHyphenValidatorTest.java
@@ -17,21 +17,19 @@
  */
 package cc.redpen.validator.sentence;
 
-import cc.redpen.model.Sentence;
-import cc.redpen.validator.ValidationError;
-import org.junit.Test;
-
 import cc.redpen.RedPen;
 import cc.redpen.RedPenException;
 import cc.redpen.config.Configuration;
 import cc.redpen.config.ValidatorConfiguration;
 import cc.redpen.model.Document;
+import cc.redpen.model.Sentence;
+import cc.redpen.validator.ValidationError;
+import org.junit.Test;
 
 import java.io.File;
-import java.util.Map;
-
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 import static org.junit.Assert.assertEquals;
 
@@ -181,13 +179,12 @@ public class KatakanaEndHyphenValidatorTest {
 
     @Test
     public void testHonorsSkipWordList() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(new ValidatorConfiguration("KatakanaEndHyphen")
-                        .addAttribute("list", "コーヒー"))
-                .setLanguage("ja").build();
+        Configuration config = Configuration.builder("ja")
+                .addValidatorConfig(new ValidatorConfiguration("KatakanaEndHyphen").addAttribute("list", "コーヒー"))
+                .build();
 
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("濃いコーヒーは胃にわるい。", 1))
@@ -200,13 +197,13 @@ public class KatakanaEndHyphenValidatorTest {
 
     @Test
     public void testHonorsSkipWordDict() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("KatakanaEndHyphen")
                         .addAttribute("dict", "src/test/resources/cc/redpen/validator/KatakanaEndHyphenValidatorTest-skipworddict.txt")) // XXX
-                .setLanguage("ja").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("コーヒーと紅茶と、どちらがお好きですか。", 1))
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/KatakanaSpellCheckValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/KatakanaSpellCheckValidatorTest.java
index cdb261d1..3b8a52d8 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/KatakanaSpellCheckValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/KatakanaSpellCheckValidatorTest.java
@@ -69,13 +69,13 @@ public class KatakanaSpellCheckValidatorTest {
 
     @Test
     public void testLoadDefaultDictionary() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("KatakanaSpellCheck"))
-                .setLanguage("ja").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder(new JapaneseTokenizer())
+                Document.builder(new JapaneseTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("あのインデクスとこのインデックス", 1))
@@ -88,13 +88,13 @@ public class KatakanaSpellCheckValidatorTest {
 
     @Test
     public void testDefaultSetting() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("KatakanaSpellCheck"))
-                .setLanguage("ja").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder(new JapaneseTokenizer())
+                Document.builder(new JapaneseTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("あのミニマムサポートとこのミニマムサポータ", 1))
@@ -107,14 +107,13 @@ public class KatakanaSpellCheckValidatorTest {
 
     @Test
     public void testSetMinimumRatio() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(new ValidatorConfiguration("KatakanaSpellCheck")
-                        .addAttribute("min_ratio", "0.001"))
-                .setLanguage("ja").build();
+        Configuration config = Configuration.builder("ja")
+                .addValidatorConfig(new ValidatorConfiguration("KatakanaSpellCheck").addAttribute("min_ratio", "0.001"))
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder(new JapaneseTokenizer())
+                Document.builder(new JapaneseTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("あのミニマムサポートとこのミニマムサポータ", 1))
@@ -127,14 +126,13 @@ public class KatakanaSpellCheckValidatorTest {
 
     @Test
     public void testSetMinimumFrequency() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(new ValidatorConfiguration("KatakanaSpellCheck")
-                        .addAttribute("min_freq", "0"))
-                .setLanguage("ja").build();
+        Configuration config = Configuration.builder("ja")
+                .addValidatorConfig(new ValidatorConfiguration("KatakanaSpellCheck").addAttribute("min_freq", "0"))
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder(new JapaneseTokenizer())
+                Document.builder(new JapaneseTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("あのミニマムサポートとこのミニマムサポータ", 1))
@@ -147,13 +145,13 @@ public class KatakanaSpellCheckValidatorTest {
 
     @Test
     public void testLoadUserDictionary() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("KatakanaSpellCheck").addAttribute("list", "ミニマムサポート,ミニマムサポータ"))
-                .setLanguage("ja").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("あのミニマムサポートとこのミニマムサポータ。", 1))
@@ -166,12 +164,12 @@ public class KatakanaSpellCheckValidatorTest {
 
     @Test
     public void testDisableDefaultDictionary() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("KatakanaSpellCheck").addAttribute("disable-default", "true"))
-                .setLanguage("ja").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder()
+                Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("あのインデクスとこのインデックス", 1))
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/OkuriganaValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/OkuriganaValidatorTest.java
index 439730df..d0e38205 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/OkuriganaValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/OkuriganaValidatorTest.java
@@ -36,10 +36,8 @@ public class OkuriganaValidatorTest {
     @Test
     public void testInvalidOkurigana() throws Exception {
         String sampleText = "このタスクに長い年月を費してきた。";
-        Configuration config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("Okurigana"))
-                .setLanguage("ja")
+        Configuration config = Configuration.builder("ja")
+                .addValidatorConfig(new ValidatorConfiguration("Okurigana"))
                 .build();
 
         DocumentParser parser = DocumentParser.MARKDOWN;
@@ -60,10 +58,8 @@ public class OkuriganaValidatorTest {
     @Test
     public void testNoInvalidOkurigana() throws Exception {
         String sampleText = "このタスクに長い年月を費やしてきた。";
-        Configuration config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("Okurigana"))
-                .setLanguage("ja")
+        Configuration config = Configuration.builder("ja")
+                .addValidatorConfig(new ValidatorConfiguration("Okurigana"))
                 .build();
 
         DocumentParser parser = DocumentParser.MARKDOWN;
@@ -83,10 +79,8 @@ public class OkuriganaValidatorTest {
     @Test
     public void testInvalidOkuriganaWithRule() throws Exception {
         String sampleText = "彼に合せた。";
-        Configuration config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("Okurigana"))
-                .setLanguage("ja")
+        Configuration config = Configuration.builder("ja")
+                .addValidatorConfig(new ValidatorConfiguration("Okurigana"))
                 .build();
 
         DocumentParser parser = DocumentParser.MARKDOWN;
@@ -109,10 +103,8 @@ public class OkuriganaValidatorTest {
     @Test
     public void testValidOkuriganaWithRule() throws Exception {
         String sampleText = "それとは競合している。";
-        Configuration config = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("Okurigana"))
-                .setLanguage("ja")
+        Configuration config = Configuration.builder("ja")
+                .addValidatorConfig(new ValidatorConfiguration("Okurigana"))
                 .build();
 
         DocumentParser parser = DocumentParser.MARKDOWN;
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/ParenthesizedSentenceValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/ParenthesizedSentenceValidatorTest.java
index f3c80e7a..9ed58408 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/ParenthesizedSentenceValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/ParenthesizedSentenceValidatorTest.java
@@ -35,7 +35,7 @@ public class ParenthesizedSentenceValidatorTest {
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder(new WhiteSpaceTokenizer())
+                Document.builder(new WhiteSpaceTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("When it comes to the subject of cake (the sweet and delicious baked delicacy), one should" +
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/QuotationValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/QuotationValidatorTest.java
index 4c1b9b81..fe9040c4 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/QuotationValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/QuotationValidatorTest.java
@@ -169,8 +169,7 @@ public class QuotationValidatorTest {
 
     @Test
     public void testAsciiExceptionCase() throws RedPenException {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("Quotation").addAttribute("use_ascii", false))
                 .build();
         Validator validator = ValidatorFactory.getInstance(conf.getValidatorConfigs().get(0), conf.getSymbolTable());
@@ -184,8 +183,7 @@ public class QuotationValidatorTest {
 
     @Test
     public void testAsciiDoubleQuotationMakrk() throws RedPenException {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("Quotation").addAttribute("use_ascii", false))
                 .build();
         Validator validator = ValidatorFactory.getInstance(conf.getValidatorConfigs().get(0), conf.getSymbolTable());
@@ -199,8 +197,7 @@ public class QuotationValidatorTest {
 
     @Test
     public void testNoQuotationMakrk() throws RedPenException {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("Quotation").addAttribute("use_ascii", true))
                 .build();
         Validator validator = ValidatorFactory.getInstance(conf.getValidatorConfigs().get(0), conf.getSymbolTable());
@@ -214,8 +211,7 @@ public class QuotationValidatorTest {
 
     @Test
     public void testNoInput() throws RedPenException {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("Quotation").addAttribute("use_ascii", true))
                 .build();
         Validator validator = ValidatorFactory.getInstance(conf.getValidatorConfigs().get(0), conf.getSymbolTable());
@@ -262,8 +258,7 @@ public class QuotationValidatorTest {
 
     @Test
     public void testLeftAsciiDoubleQuotationsWihtoutSpace() throws RedPenException {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("Quotation").addAttribute("use_ascii", true))
                 .build();
         Validator validator = ValidatorFactory.getInstance(conf.getValidatorConfigs().get(0), conf.getSymbolTable());
@@ -288,8 +283,7 @@ public class QuotationValidatorTest {
 
     @Test
     public void testRightAsciiDoubleQuotationsWihtoutSpace() throws RedPenException {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("Quotation").addAttribute("use_ascii", true))
                 .build();
         Validator validator = ValidatorFactory.getInstance(conf.getValidatorConfigs().get(0), conf.getSymbolTable());
@@ -303,8 +297,7 @@ public class QuotationValidatorTest {
 
     @Test
     public void testDoubleQuotationsWithNonAsciiPeriod() throws RedPenException {
-        Configuration conf = new Configuration.ConfigurationBuilder()
-                .setLanguage("en")
+        Configuration conf = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("Quotation").addAttribute("use_ascii", true))
                 .addSymbol(new Symbol(SymbolType.FULL_STOP, '。'))
                 .build();
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/SpaceBeginningOfSpenceValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/SpaceBeginningOfSpenceValidatorTest.java
index 5f149e49..d2cce5bb 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/SpaceBeginningOfSpenceValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/SpaceBeginningOfSpenceValidatorTest.java
@@ -35,12 +35,12 @@ import static org.junit.Assert.assertEquals;
 public class SpaceBeginningOfSpenceValidatorTest {
     @Test
     public void testProcessSentenceWithoutEndSpace() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("SpaceBeginningOfSentence"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
-                documents.add(new Document.DocumentBuilder()
+                documents.add(Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("this is a test.", 1)) // ok since the sentence begins with the beginning of the line 1
@@ -54,12 +54,12 @@ public class SpaceBeginningOfSpenceValidatorTest {
 
     @Test
     public void testProcessFirstSpace() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("SpaceBeginningOfSentence"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
-                documents.add(new Document.DocumentBuilder()
+                documents.add(Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("this is a test", 1))
@@ -73,12 +73,12 @@ public class SpaceBeginningOfSpenceValidatorTest {
 
     @Test
     public void testProcessHeadSentenceInAParagraph() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("SpaceBeginningOfSentence"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
-                documents.add(new Document.DocumentBuilder()
+                documents.add(Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("This is a test", 1))
@@ -91,12 +91,12 @@ public class SpaceBeginningOfSpenceValidatorTest {
 
     @Test
     public void testProcessZeroLengthSentence() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("SpaceBeginningOfSentence"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
-                documents.add(new Document.DocumentBuilder()
+                documents.add(Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("", 0))
@@ -109,12 +109,12 @@ public class SpaceBeginningOfSpenceValidatorTest {
 
     @Test
     public void testProcessNewLineSentenceWithoutEndSpace() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("SpaceBeginningOfSentence"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
-                documents.add(new Document.DocumentBuilder()
+                documents.add(Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("this is a test.", 1))
@@ -128,12 +128,12 @@ public class SpaceBeginningOfSpenceValidatorTest {
 
     @Test
     public void testProcessVoidSentence() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("SpaceBeginningOfSentence"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
-                documents.add(new Document.DocumentBuilder()
+                documents.add(Document.builder()
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("", 1))
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/SpaceBetweenAlphabeticalWordValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/SpaceBetweenAlphabeticalWordValidatorTest.java
index c0232521..ff0e1fbd 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/SpaceBetweenAlphabeticalWordValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/SpaceBetweenAlphabeticalWordValidatorTest.java
@@ -85,12 +85,12 @@ public class SpaceBetweenAlphabeticalWordValidatorTest {
 
     @Test
     public void testWithParenthesis() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("SpaceBetweenAlphabeticalWord"))
-                .setLanguage("ja").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder(new JapaneseTokenizer())
+                Document.builder(new JapaneseTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("きょうは（Coke）を飲みたい。", 1))
@@ -103,12 +103,12 @@ public class SpaceBetweenAlphabeticalWordValidatorTest {
 
     @Test
     public void testWithComma() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder("ja")
                 .addValidatorConfig(new ValidatorConfiguration("SpaceBetweenAlphabeticalWord"))
-                .setLanguage("ja").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();documents.add(
-                new Document.DocumentBuilder(new JapaneseTokenizer())
+                Document.builder(new JapaneseTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("きょうは、Coke を飲みたい。", 1))
@@ -122,9 +122,8 @@ public class SpaceBetweenAlphabeticalWordValidatorTest {
     @Test
     public void testErrorBeforePosition() throws RedPenException {
         String sampleText = "きょうはCoke を飲みたい。";
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("SpaceBetweenAlphabeticalWord"))
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("SpaceBetweenAlphabeticalWord"))
                 .build();
         DocumentParser parser = DocumentParser.MARKDOWN;
         List<Document> documents = new ArrayList<>();
@@ -143,9 +142,8 @@ public class SpaceBetweenAlphabeticalWordValidatorTest {
     @Test
     public void testErrorAfterPosition() throws RedPenException {
         String sampleText = "きょうは Cokeを飲みたい。";
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("SpaceBetweenAlphabeticalWord"))
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("SpaceBetweenAlphabeticalWord"))
                 .build();
         DocumentParser parser = DocumentParser.MARKDOWN;
         List<Document> documents = new ArrayList<>();
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/SpellingValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/SpellingValidatorTest.java
index 3f0ed135..65289c97 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/SpellingValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/SpellingValidatorTest.java
@@ -42,9 +42,9 @@ public class SpellingValidatorTest extends BaseValidatorTest {
 
     @Test
     public void testValidate() throws Exception {
-        config = new Configuration.ConfigurationBuilder()
+        config = Configuration.builder()
           .addValidatorConfig(new ValidatorConfiguration(validatorName).addAttribute("list", "this,a,pen"))
-          .setLanguage("en").build();
+          .build();
 
         Document document = prepareSimpleDocument("this iz a pen");
 
@@ -86,9 +86,9 @@ public class SpellingValidatorTest extends BaseValidatorTest {
 
     @Test
     public void testUserSkipList() throws RedPenException {
-        config = new Configuration.ConfigurationBuilder()
+        config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration(validatorName).addAttribute("list", "abeshi,baz"))
-                .setLanguage("en").build();
+                .build();
 
         Document document = prepareSimpleDocument("Abeshi is a word used in a comic.");
 
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/StartWithCapitalLetterValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/StartWithCapitalLetterValidatorTest.java
index f85699e4..f890444e 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/StartWithCapitalLetterValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/StartWithCapitalLetterValidatorTest.java
@@ -40,14 +40,14 @@ public class StartWithCapitalLetterValidatorTest {
     @Test
     public void testDetectStartWithSmallCharacter() throws RedPenException {
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder()
+        documents.add(Document.builder()
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("this is it.", 1))
                 .build());
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("StartWithCapitalLetter"))
-                .setLanguage("en").build();
+                .build();
         Validator validator = ValidatorFactory.getInstance(config.getValidatorConfigs().get(0), config.getSymbolTable());
         List<ValidationError> errors = new ArrayList<>();
         validator.setErrorList(errors);
@@ -58,14 +58,14 @@ public class StartWithCapitalLetterValidatorTest {
     @Test
     public void testDetectStartWithCapitalCharacter() throws RedPenException {
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder()
+        documents.add(Document.builder()
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("This is it.", 1))
                 .build());
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("StartWithCapitalLetter"))
-                .setLanguage("en").build();
+                .build();
         Validator validator = ValidatorFactory.getInstance(config.getValidatorConfigs().get(0), config.getSymbolTable());
         List<ValidationError> errors = new ArrayList<>();
         validator.setErrorList(errors);
@@ -76,14 +76,14 @@ public class StartWithCapitalLetterValidatorTest {
     @Test
     public void testStartWithElementOfWhiteList() throws RedPenException {
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder()
+        documents.add(Document.builder()
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("iPhone is a mobile computer.", 1))
                 .build());
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("StartWithCapitalLetter").addAttribute("list", "iPhone"))
-                .setLanguage("en").build();
+                .build();
         Validator validator = ValidatorFactory.getInstance(config.getValidatorConfigs().get(0), config.getSymbolTable());
         List<ValidationError> errors = new ArrayList<>();
         validator.setErrorList(errors);
@@ -94,14 +94,14 @@ public class StartWithCapitalLetterValidatorTest {
     @Test
     public void testStartWithWhiteListItemInJapaneseSentence() throws RedPenException {
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder(new JapaneseTokenizer())
+        documents.add(Document.builder(new JapaneseTokenizer())
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("iPhone はカッコイイ．", 1))
                 .build());
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("StartWithCapitalLetter").addAttribute("list", "iPhone"))
-                .setLanguage("en").build();
+                .build();
         Validator validator = ValidatorFactory.getInstance(config.getValidatorConfigs().get(0), config.getSymbolTable());
         List<ValidationError> errors = new ArrayList<>();
         validator.setErrorList(errors);
@@ -112,14 +112,14 @@ public class StartWithCapitalLetterValidatorTest {
     @Test
     public void testStartWithWhiteSpaceAndThenItemOfWhiteList() throws RedPenException {
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder()
+        documents.add(Document.builder()
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence(" iPhone is a mobile computer.", 1))
                 .build());
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("StartWithCapitalLetter").addAttribute("list", "iPhone"))
-                .setLanguage("en").build();
+                .build();
         Validator validator = ValidatorFactory.getInstance(config.getValidatorConfigs().get(0), config.getSymbolTable());
         List<ValidationError> errors = new ArrayList<>();
         validator.setErrorList(errors);
@@ -130,14 +130,14 @@ public class StartWithCapitalLetterValidatorTest {
     @Test
     public void testVoid() throws RedPenException {
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder()
+        documents.add(Document.builder()
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("", 1))
                 .build());
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("StartWithCapitalLetter").addAttribute("list", "iPhone"))
-                .setLanguage("en").build();
+                .build();
         Validator validator = ValidatorFactory.getInstance(config.getValidatorConfigs().get(0), config.getSymbolTable());
         List<ValidationError> errors = new ArrayList<>();
         validator.setErrorList(errors);
@@ -147,12 +147,12 @@ public class StartWithCapitalLetterValidatorTest {
 
     @Test
     public void testLoadDefaultDictionary() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("StartWithCapitalLetter"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder()
+        documents.add(Document.builder()
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("mixi is a Japanese company.", 1))
@@ -166,12 +166,12 @@ public class StartWithCapitalLetterValidatorTest {
 
     @Test
     public void testDetectStartWithSmallCharacterInSecondSentence() throws RedPenException {
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("StartWithCapitalLetter"))
-                .setLanguage("en").build();
+                .build();
 
         List<Document> documents = new ArrayList<>();
-        documents.add(new Document.DocumentBuilder()
+        documents.add(Document.builder()
                 .addSection(1)
                 .addParagraph()
                 .addSentence(new Sentence("This is true.", 1))
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/SymbolWithSpaceValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/SymbolWithSpaceValidatorTest.java
index f6ded740..12eaa027 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/SymbolWithSpaceValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/SymbolWithSpaceValidatorTest.java
@@ -50,9 +50,8 @@ public class SymbolWithSpaceValidatorTest extends BaseValidatorTest {
     public void testNotNeedSpace() throws RedPenException {
         Document document = prepareSimpleDocument("I like apple/orange");
 
-        config = new Configuration.ConfigurationBuilder()
+        config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("SymbolWithSpace"))
-                .setLanguage("en")
                 .addSymbol(new Symbol(SLASH, '/'))
                 .build();
 
@@ -65,9 +64,8 @@ public class SymbolWithSpaceValidatorTest extends BaseValidatorTest {
     public void testNeedAfterSpace() throws RedPenException {
         Document document = prepareSimpleDocument("I like her:yes it is");
 
-        config = new Configuration.ConfigurationBuilder()
+        config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("SymbolWithSpace"))
-                .setLanguage("en")
                 .addSymbol(new Symbol(COLON, ':', "", false, true))
                 .build();
 
@@ -82,9 +80,8 @@ public class SymbolWithSpaceValidatorTest extends BaseValidatorTest {
     public void testNeedBeforeSpace() throws RedPenException {
         Document document = prepareSimpleDocument("I like her(Nancy) very much.");
 
-        config = new Configuration.ConfigurationBuilder()
+        config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("SymbolWithSpace"))
-                .setLanguage("en")
                 .addSymbol(new Symbol(LEFT_PARENTHESIS, '(', "", true, false))
                 .build();
 
@@ -99,9 +96,8 @@ public class SymbolWithSpaceValidatorTest extends BaseValidatorTest {
     public void testNeedSpaceInMultiplePosition() throws RedPenException {
         Document document = prepareSimpleDocument("I like her(Nancy)very much.");
 
-        config = new Configuration.ConfigurationBuilder()
+        config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("SymbolWithSpace"))
-                .setLanguage("en")
                 .addSymbol(new Symbol(LEFT_PARENTHESIS, '(', "", true, false))
                 .addSymbol(new Symbol(RIGHT_PARENTHESIS, ')', "", false, true))
                 .build();
@@ -117,9 +113,8 @@ public class SymbolWithSpaceValidatorTest extends BaseValidatorTest {
     public void testReturnOnlyOneForHitBothBeforeAndAfter() throws RedPenException {
         Document document = prepareSimpleDocument("I like 1*10.");
 
-        Configuration config = new Configuration.ConfigurationBuilder()
+        Configuration config = Configuration.builder()
                 .addValidatorConfig(new ValidatorConfiguration("SymbolWithSpace"))
-                .setLanguage("en")
                 .addSymbol(new Symbol(ASTERISK, '*', "", true, true))
                 .build();
 
@@ -132,9 +127,8 @@ public class SymbolWithSpaceValidatorTest extends BaseValidatorTest {
     @Test
     public void testErrorBeforePosition() throws RedPenException {
         String sampleText = "I like her(Nancy) very much.";
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("SymbolWithSpace"))
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("SymbolWithSpace"))
                 .build();
         DocumentParser parser = DocumentParser.MARKDOWN;
         List<Document> documents = new ArrayList<>();
@@ -154,9 +148,8 @@ public class SymbolWithSpaceValidatorTest extends BaseValidatorTest {
     @Test
     public void testErrorAfterPosition() throws RedPenException {
         String sampleText = "I like her (Nancy)very much.";
-        Configuration configuration = new Configuration.ConfigurationBuilder()
-                .addValidatorConfig(
-                        new ValidatorConfiguration("SymbolWithSpace"))
+        Configuration configuration = Configuration.builder()
+                .addValidatorConfig(new ValidatorConfiguration("SymbolWithSpace"))
                 .build();
         DocumentParser parser = DocumentParser.MARKDOWN;
         List<Document> documents = new ArrayList<>();
diff --git a/redpen-core/src/test/java/cc/redpen/validator/sentence/WeakExpressionValidatorTest.java b/redpen-core/src/test/java/cc/redpen/validator/sentence/WeakExpressionValidatorTest.java
index 9a514d65..6ae4514d 100644
--- a/redpen-core/src/test/java/cc/redpen/validator/sentence/WeakExpressionValidatorTest.java
+++ b/redpen-core/src/test/java/cc/redpen/validator/sentence/WeakExpressionValidatorTest.java
@@ -37,7 +37,7 @@ public class WeakExpressionValidatorTest {
 
         List<Document> documents = new ArrayList<>();
         documents.add(
-                new Document.DocumentBuilder(new WhiteSpaceTokenizer())
+                Document.builder(new WhiteSpaceTokenizer())
                         .addSection(1)
                         .addParagraph()
                         .addSentence(new Sentence("As a matter of fact, some things are very small.", 1))