Repository: w3c/epubcheck
Pull request #1346 (2022-08-18 14:48:08)

Internal refactoring of the checkers API
- unify `ContentChecker`/`DocumentValidator` into a new `Checker` interface
- refactor checkers into `AbstractChecker` (default empty implementation) +  `PublicationResourceChecker` (contains boilerplate code shared by resource checkers)
- introduced a new `MIMEType` utility enum (replacing public static strings)
- all the new APIs are located in new `org.w3c.epubcheck.*` packages


Patch:
diff --git a/pom.xml b/pom.xml
index 3b4a7569..206d1575 100644
--- a/pom.xml
+++ b/pom.xml
@@ -162,7 +162,7 @@
     </distributionManagement>
 
     <properties>
-        <java.version>1.7</java.version>
+        <java.version>1.8</java.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
         <maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
diff --git a/src/main/java/com/adobe/epubcheck/api/EpubCheck.java b/src/main/java/com/adobe/epubcheck/api/EpubCheck.java
index 57fff631..3c5ca47c 100644
--- a/src/main/java/com/adobe/epubcheck/api/EpubCheck.java
+++ b/src/main/java/com/adobe/epubcheck/api/EpubCheck.java
@@ -32,13 +32,14 @@ import java.util.Locale;
 import java.util.Properties;
 import java.util.zip.ZipFile;
 
+import org.w3c.epubcheck.constants.MIMEType;
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.ctc.CheckManager;
 import com.adobe.epubcheck.messages.MessageId;
 import com.adobe.epubcheck.ocf.OCFChecker;
 import com.adobe.epubcheck.ocf.OCFPackage;
 import com.adobe.epubcheck.ocf.OCFZipPackage;
-import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.opf.OPFData;
 import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
 import com.adobe.epubcheck.util.DefaultReportImpl;
 import com.adobe.epubcheck.util.EPUBVersion;
@@ -48,7 +49,7 @@ import com.adobe.epubcheck.util.WriterReportImpl;
 /**
  * Public interface to epub validator.
  */
-public class EpubCheck implements DocumentValidator
+public class EpubCheck implements Checker
 {
   private static String VERSION = null;
   private static String BUILD_DATE = null;
@@ -199,10 +200,9 @@ public class EpubCheck implements DocumentValidator
   /**
    * Validate the file. Return true if no errors or warnings found.
    */
-  public boolean validate()
+  public void check()
   {
-    int validateResult = doValidate();
-    return validateResult == 0;
+    doValidate();
   }
 
   public int doValidate()
@@ -221,7 +221,7 @@ public class EpubCheck implements DocumentValidator
       OCFPackage ocf = new OCFZipPackage(zip);
       OCFChecker checker = new OCFChecker(new ValidationContextBuilder()
           .path(epubFile.getAbsolutePath()).ocf(ocf).report(report).profile(profile).build());
-      checker.runChecks();
+      checker.check();
 
       String extension = ResourceUtil.getExtension(epubFile.getName());
       checkExtension(ocf, extension);
@@ -267,7 +267,7 @@ public class EpubCheck implements DocumentValidator
         }
         else
         {
-          List<String> opfPaths = ocf.getOcfData().getEntries(OPFData.OPF_MIME_TYPE);
+          List<String> opfPaths = ocf.getOcfData().getEntries(MIMEType.PACKAGE_DOC.toString());
           if (!opfPaths.isEmpty()) {
             if(ocf.getOpfData().get(opfPaths.get(0)).getVersion() == EPUBVersion.VERSION_3) {
               report.message(MessageId.PKG_024, EPUBLocation.create(epubFile.getName(), extension));
diff --git a/src/main/java/com/adobe/epubcheck/api/EpubCheckFactory.java b/src/main/java/com/adobe/epubcheck/api/EpubCheckFactory.java
index eea752b4..22999c44 100644
--- a/src/main/java/com/adobe/epubcheck/api/EpubCheckFactory.java
+++ b/src/main/java/com/adobe/epubcheck/api/EpubCheckFactory.java
@@ -25,11 +25,11 @@ package com.adobe.epubcheck.api;
 import java.io.File;
 import java.io.IOException;
 
-import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.opf.DocumentValidatorFactory;
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.opf.ValidationContext;
 
-public class EpubCheckFactory implements DocumentValidatorFactory
+public class EpubCheckFactory
 {
   static private final EpubCheckFactory instance = new EpubCheckFactory();
 
@@ -38,7 +38,7 @@ public class EpubCheckFactory implements DocumentValidatorFactory
     return instance;
   }
 
-  public DocumentValidator newInstance(ValidationContext context)
+  public Checker newInstance(ValidationContext context)
   {
     if (context.path.startsWith("http://") || context.path.startsWith("https://"))
     {
diff --git a/src/main/java/com/adobe/epubcheck/bitmap/BitmapChecker.java b/src/main/java/com/adobe/epubcheck/bitmap/BitmapChecker.java
index 2550fa90..29828bcf 100755
--- a/src/main/java/com/adobe/epubcheck/bitmap/BitmapChecker.java
+++ b/src/main/java/com/adobe/epubcheck/bitmap/BitmapChecker.java
@@ -34,33 +34,27 @@ import javax.imageio.stream.FileImageInputStream;
 import javax.imageio.stream.ImageInputStream;
 
 import com.adobe.epubcheck.api.EPUBLocation;
-import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.messages.MessageId;
 import com.adobe.epubcheck.ocf.OCFPackage;
 import com.adobe.epubcheck.ocf.OCFZipPackage;
-import com.adobe.epubcheck.opf.ContentChecker;
+import com.adobe.epubcheck.opf.PublicationResourceChecker;
+import com.adobe.epubcheck.opf.ValidationContext;
 import com.adobe.epubcheck.util.CheckUtil;
 
-public class BitmapChecker implements ContentChecker
+public class BitmapChecker extends PublicationResourceChecker
 {
-  private final OCFPackage ocf;
-  private final Report report;
-  private final String path;
-  private final String mimeType;
   private static final int HEIGHT_MAX = 2 * 1080;
   private static final int WIDTH_MAX = 2 * 1920;
   private static final long IMAGESIZE_MAX = 4 * 1024 * 1024;
 
-  BitmapChecker(OCFPackage ocf, Report report, String path, String mimeType)
+  public BitmapChecker(ValidationContext context)
   {
-    this.ocf = ocf;
-    this.report = report;
-    this.path = path;
-    this.mimeType = mimeType;
+    super(context);
   }
 
   private void checkHeader(byte[] header)
   {
+    String mimeType = context.mimeType;
     boolean passed;
     if (mimeType.equals("image/jpeg"))
     {
@@ -77,7 +71,7 @@ public class BitmapChecker implements ContentChecker
     }
     if (!passed)
     {
-      report.message(MessageId.OPF_029, EPUBLocation.create(this.ocf.getName()), path, mimeType);
+      report.message(MessageId.OPF_029, EPUBLocation.create(context.ocf.get().getName()), context.path, mimeType);
     }
   }
 
@@ -92,6 +86,7 @@ public class BitmapChecker implements ContentChecker
   public ImageHeuristics getImageSizes(String imgFileName) throws
       IOException
   {
+    OCFPackage ocf = context.ocf.get();
     int pos = imgFileName.lastIndexOf(".");
     if (pos == -1)
     {
@@ -186,7 +181,7 @@ public class BitmapChecker implements ContentChecker
       }
   }
 
-  private File getImageFile(OCFPackage ocf, String imgFileName) throws IOException
+  private static File getImageFile(OCFPackage ocf, String imgFileName) throws IOException
   {
     if (ocf.getClass() == OCFZipPackage.class)
     {
@@ -212,7 +207,7 @@ public class BitmapChecker implements ContentChecker
     }
   }
 
-  private File getTempImageFile(OCFZipPackage ocf, String imgFileName) throws IOException
+  private static File getTempImageFile(OCFZipPackage ocf, String imgFileName) throws IOException
   {
     File file = null;
     FileOutputStream os = null;
@@ -283,56 +278,33 @@ public class BitmapChecker implements ContentChecker
     }
   }
 
-  public void runChecks()
+  @Override
+  protected boolean checkContent()
   {
-    if (!ocf.hasEntry(path))
+    try (InputStream in = context.resourceProvider.getInputStream(context.path))
     {
-      report.message(MessageId.RSC_001, EPUBLocation.create(this.ocf.getName()), path);
-    }
-    else if (!ocf.canDecrypt(path))
-    {
-      report.message(MessageId.RSC_004, EPUBLocation.create(this.ocf.getName()), path);
-    }
-    else
-    {
-      InputStream in = null;
-      try
+      if (in == null)
       {
-        in = ocf.getInputStream(path);
-        if (in == null)
-        {
-          report.message(MessageId.RSC_001, EPUBLocation.create(this.ocf.getName()), path);
-        }
-        byte[] header = new byte[4];
-        int rd = CheckUtil.readBytes(in, header, 0, 4);
-        if (rd < 4)
-        {
-          report.message(MessageId.MED_004, EPUBLocation.create(path));
-        }
-        else
-        {
-          checkHeader(header);
-        }
-        checkImageDimensions(path);
+        report.message(MessageId.RSC_001, EPUBLocation.create(context.path));
+        return false;
       }
-      catch (IOException e)
+      byte[] header = new byte[4];
+      int rd = CheckUtil.readBytes(in, header, 0, 4);
+      if (rd < 4)
       {
-        report.message(MessageId.PKG_021, EPUBLocation.create(path, path));
+        report.message(MessageId.MED_004, EPUBLocation.create(context.path));
       }
-      finally
+      else
       {
-        try
-        {
-          if (in != null)
-          {
-            in.close();
-          }
-        }
-        catch (IOException ignored)
-        {
-          // eat it
-        }
+        checkHeader(header);
       }
+      checkImageDimensions(context.path);
+      return true;
     }
-  }
+    catch (IOException e)
+    {
+      report.message(MessageId.PKG_021, EPUBLocation.create(context.path, context.path));
+      return false;
+    }
+   }
 }
diff --git a/src/main/java/com/adobe/epubcheck/bitmap/BitmapCheckerFactory.java b/src/main/java/com/adobe/epubcheck/bitmap/BitmapCheckerFactory.java
deleted file mode 100755
index 8eb962e5..00000000
--- a/src/main/java/com/adobe/epubcheck/bitmap/BitmapCheckerFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2007 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.bitmap;
-
-import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.ValidationContext;
-
-public class BitmapCheckerFactory implements ContentCheckerFactory
-{
-  static private final BitmapCheckerFactory instance = new BitmapCheckerFactory();
-
-  public BitmapChecker newInstance(ValidationContext context)
-  {
-    return new BitmapChecker(context.ocf.get(), context.report, context.path, context.mimeType);
-  }
-
-  static public BitmapCheckerFactory getInstance()
-  {
-    return instance;
-  }
-}
diff --git a/src/main/java/com/adobe/epubcheck/css/CSSChecker.java b/src/main/java/com/adobe/epubcheck/css/CSSChecker.java
index 9a5f3b6b..3a11dd1b 100644
--- a/src/main/java/com/adobe/epubcheck/css/CSSChecker.java
+++ b/src/main/java/com/adobe/epubcheck/css/CSSChecker.java
@@ -32,17 +32,12 @@ import org.idpf.epubcheck.util.css.CssParser;
 import org.idpf.epubcheck.util.css.CssSource;
 
 import com.adobe.epubcheck.api.EPUBLocation;
-import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.opf.ContentChecker;
+import com.adobe.epubcheck.opf.PublicationResourceChecker;
 import com.adobe.epubcheck.opf.ValidationContext;
 
-public class CSSChecker implements ContentChecker
+public class CSSChecker extends PublicationResourceChecker
 {
-  private final ValidationContext context;
-  private final Report report;
-  private final String path; // css file path when Mode.FILE, host path when
-                             // Mode.STRING
   private final Mode mode;
 
   // Below only used when checking css strings
@@ -75,27 +70,29 @@ public class CSSChecker implements ContentChecker
   private CSSChecker(ValidationContext context, Mode mode, String value, int line,
       boolean isStyleAttribute)
   {
-    this.context = context;
-    this.report = context.report;
-    this.path = context.path;
+    super(context);
     this.mode = mode;
     this.value = value;
     this.line = line;
     this.isStyleAttribute = isStyleAttribute;
   }
+  
+  @Override
+  protected boolean checkPublicationBeforeContent()
+  {
+    if (this.mode == Mode.FILE) {
+      return super.checkPublicationBeforeContent();
+    }
+    return true;
+  }
 
-  public void runChecks()
+  @Override
+  protected boolean checkContent()
   {
     CssSource source = null;
 
     try
     {
-      if (this.mode == Mode.FILE && !context.ocf.get().hasEntry(path))
-      {
-        report.message(MessageId.RSC_001, EPUBLocation.create(context.ocf.get().getName()),
-            path);
-        return;
-      }
 
       CSSHandler handler = new CSSHandler(context);
       if (this.mode == Mode.STRING && this.line > -1)
@@ -109,7 +106,7 @@ public class CSSChecker implements ContentChecker
       this.line = -1;
     } catch (Exception e)
     {
-      report.message(MessageId.PKG_008, EPUBLocation.create(path), e.getMessage());
+      report.message(MessageId.PKG_008, EPUBLocation.create(context.path), e.getMessage());
     } finally
     {
       if (source != null)
@@ -127,6 +124,7 @@ public class CSSChecker implements ContentChecker
         }
       }
     }
+    return true;
   }
 
   CssSource getCssSource()
@@ -135,14 +133,14 @@ public class CSSChecker implements ContentChecker
     CssSource source = null;
     if (this.mode == Mode.FILE)
     {
-      source = new CssSource(this.path, context.resourceProvider.getInputStream(this.path));
+      source = new CssSource(context.path, context.resourceProvider.getInputStream(context.path));
       String charset;
       if (source.getInputStream().getBomCharset().isPresent())
       {
         charset = source.getInputStream().getBomCharset().get().toLowerCase(Locale.ROOT);
         if (!charset.equals("utf-8") && !charset.startsWith("utf-16"))
         {
-          report.message(MessageId.CSS_004, EPUBLocation.create(path), charset);
+          report.message(MessageId.CSS_004, EPUBLocation.create(context.path), charset);
         }
       }
       if (source.getInputStream().getCssCharset().isPresent())
@@ -150,7 +148,7 @@ public class CSSChecker implements ContentChecker
         charset = source.getInputStream().getCssCharset().get().toLowerCase(Locale.ROOT);
         if (!charset.equals("utf-8") && !charset.startsWith("utf-16"))
         {
-          report.message(MessageId.CSS_003, EPUBLocation.create(path, ""), charset);
+          report.message(MessageId.CSS_003, EPUBLocation.create(context.path, ""), charset);
         }
       }
     }
@@ -169,13 +167,13 @@ public class CSSChecker implements ContentChecker
       }
       else
       {
-        new CssParser(context.locale).parse(new StringReader(this.value), this.path, handler, handler);
+        new CssParser(context.locale).parse(new StringReader(this.value), context.path, handler, handler);
       }
     }
     else
     {
       new CssParser(context.locale)
-          .parseStyleAttribute(new StringReader(this.value), this.path, handler, handler);
+          .parseStyleAttribute(new StringReader(this.value), context.path, handler, handler);
     }
   }
 }
diff --git a/src/main/java/com/adobe/epubcheck/css/CSSCheckerFactory.java b/src/main/java/com/adobe/epubcheck/css/CSSCheckerFactory.java
deleted file mode 100644
index 0f34e510..00000000
--- a/src/main/java/com/adobe/epubcheck/css/CSSCheckerFactory.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2011 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-package com.adobe.epubcheck.css;
-
-import com.adobe.epubcheck.opf.ContentChecker;
-import com.adobe.epubcheck.opf.ValidationContext;
-import com.adobe.epubcheck.opf.ContentCheckerFactory;
-
-public class CSSCheckerFactory implements ContentCheckerFactory
-{
-  /*
-    * (non-Javadoc)
-    * @see com.adobe.epubcheck.opf.ContentCheckerFactory#newInstance(com.adobe.epubcheck.ocf.OCFPackage, com.adobe.epubcheck.api.Report, java.lang.String, java.lang.String, java.lang.String, com.adobe.epubcheck.opf.XRefChecker, com.adobe.epubcheck.util.EPUBVersion)
-    */
-  public ContentChecker newInstance(ValidationContext context)
-  {
-
-    return new CSSChecker(context);
-  }
-
-  /**
-   * Additional constructor for validating CSS strings (style attributes and elements)
-   */
-  public ContentChecker newInstance(ValidationContext context, String value, int line,
-      boolean isStyleAttribute)
-  {
-    return new CSSChecker(context, value, line, isStyleAttribute);
-  }
-
-  static private final CSSCheckerFactory instance = new CSSCheckerFactory();
-
-  static public CSSCheckerFactory getInstance()
-  {
-    return instance;
-  }
-}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/CheckManager.java b/src/main/java/com/adobe/epubcheck/ctc/CheckManager.java
index 6f68d466..b84b41d0 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/CheckManager.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/CheckManager.java
@@ -44,28 +44,28 @@ public class CheckManager
 
     if (version != null && version.equals(EPUBVersion.VERSION_3))
     {
-      factory.newInstance(report, ValidationType.RENDITION, epack).validate();
-      factory.newInstance(report, ValidationType.CFI, epack).validate();
-      factory.newInstance(report, ValidationType.METADATA_V3, epack).validate();
-      factory.newInstance(report, ValidationType.NAV, epack).validate();
+      factory.newInstance(report, ValidationType.RENDITION, epack).check();
+      factory.newInstance(report, ValidationType.CFI, epack).check();
+      factory.newInstance(report, ValidationType.METADATA_V3, epack).check();
+      factory.newInstance(report, ValidationType.NAV, epack).check();
     }
     else if (version != null && EPUBVersion.VERSION_2.equals(version))
     {
-      factory.newInstance(report, ValidationType.EPUB3_STRUCTURE, epack).validate();
-      factory.newInstance(report, ValidationType.METADATA_V2, epack).validate();
+      factory.newInstance(report, ValidationType.EPUB3_STRUCTURE, epack).check();
+      factory.newInstance(report, ValidationType.METADATA_V2, epack).check();
     }
 
-    factory.newInstance(report, ValidationType.NCX, epack).validate();
-    factory.newInstance(report, ValidationType.MULTIPLE_CSS, epack).validate();
-    factory.newInstance(report, ValidationType.HTML_STRUCTURE, epack).validate();
-    factory.newInstance(report, ValidationType.LINK, epack).validate();
-    factory.newInstance(report, ValidationType.CSS_SEARCH, epack).validate();
-    factory.newInstance(report, ValidationType.TOC, epack).validate();
-    factory.newInstance(report, ValidationType.LANG, epack).validate();
-    factory.newInstance(report, ValidationType.SPINE, epack).validate();
-    factory.newInstance(report, ValidationType.TEXT, epack).validate();
-    factory.newInstance(report, ValidationType.SCRIPT, epack).validate();
-    factory.newInstance(report, ValidationType.SPAN, epack).validate();
-    factory.newInstance(report, ValidationType.SVG, epack).validate();
+    factory.newInstance(report, ValidationType.NCX, epack).check();
+    factory.newInstance(report, ValidationType.MULTIPLE_CSS, epack).check();
+    factory.newInstance(report, ValidationType.HTML_STRUCTURE, epack).check();
+    factory.newInstance(report, ValidationType.LINK, epack).check();
+    factory.newInstance(report, ValidationType.CSS_SEARCH, epack).check();
+    factory.newInstance(report, ValidationType.TOC, epack).check();
+    factory.newInstance(report, ValidationType.LANG, epack).check();
+    factory.newInstance(report, ValidationType.SPINE, epack).check();
+    factory.newInstance(report, ValidationType.TEXT, epack).check();
+    factory.newInstance(report, ValidationType.SCRIPT, epack).check();
+    factory.newInstance(report, ValidationType.SPAN, epack).check();
+    factory.newInstance(report, ValidationType.SVG, epack).check();
   }
 }
diff --git a/src/main/java/com/adobe/epubcheck/ctc/ContentValidator.java b/src/main/java/com/adobe/epubcheck/ctc/ContentValidator.java
index 5e239896..f86bef8a 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/ContentValidator.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/ContentValidator.java
@@ -1,8 +1,9 @@
 package com.adobe.epubcheck.ctc;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
-import com.adobe.epubcheck.opf.DocumentValidator;
 
 /**
  *  ===  WARNING  ==========================================<br/>
@@ -18,5 +19,5 @@ public interface ContentValidator
     TEXT, CONTENT, SPINE, NCX, NAV, SCRIPT, SPAN, STYLE, METADATA_V3, METADATA_V2, LANG, CSS_SEARCH, LINK, RENDITION, CFI, HTML_STRUCTURE, MULTIPLE_CSS, EPUB3_STRUCTURE, TOC, SVG
   }
 
-  public DocumentValidator newInstance(Report report, ValidationType vt, EpubPackage epack);
+  public Checker newInstance(Report report, ValidationType vt, EpubPackage epack);
 }
diff --git a/src/main/java/com/adobe/epubcheck/ctc/Epub3StructureCheck.java b/src/main/java/com/adobe/epubcheck/ctc/Epub3StructureCheck.java
index d9d9cd8f..fd5f0a86 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/Epub3StructureCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/Epub3StructureCheck.java
@@ -2,12 +2,13 @@ package com.adobe.epubcheck.ctc;
 
 import java.util.zip.ZipEntry;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
 import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
 import com.adobe.epubcheck.ctc.xml.Epub3StructureHandler;
 import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.SearchDictionary;
 import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
 
@@ -18,7 +19,7 @@ import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class Epub3StructureCheck implements DocumentValidator
+public class Epub3StructureCheck implements Checker
 {
   private final Report report;
   private final EpubPackage epack;
@@ -30,7 +31,7 @@ public class Epub3StructureCheck implements DocumentValidator
   }
 
   @Override
-  public boolean validate()
+  public void check()
   {
     boolean result = false;
 
@@ -63,6 +64,5 @@ public class Epub3StructureCheck implements DocumentValidator
         }
       }
     }
-    return result;
   }
 }
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubCSSCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubCSSCheck.java
index cb3c8ad8..c1383641 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubCSSCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubCSSCheck.java
@@ -13,6 +13,7 @@ import java.util.zip.ZipFile;
 
 import org.idpf.epubcheck.util.css.CssParser;
 import org.idpf.epubcheck.util.css.CssSource;
+import org.w3c.epubcheck.core.Checker;
 
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.LocalizableReport;
@@ -24,7 +25,6 @@ import com.adobe.epubcheck.ctc.xml.CSSStyleAttributeHandler;
 import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
 import com.adobe.epubcheck.messages.MessageId;
 import com.adobe.epubcheck.ocf.EncryptionFilter;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.PathUtil;
 import com.adobe.epubcheck.util.SearchDictionary;
 import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
@@ -37,7 +37,7 @@ import com.adobe.epubcheck.util.TextSearchDictionaryEntry;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubCSSCheck implements DocumentValidator
+public class EpubCSSCheck implements Checker
 {
   final ZipFile zip;
   final Report report;
@@ -55,7 +55,7 @@ public class EpubCSSCheck implements DocumentValidator
     this.isGlobalFixed = EpubPackage.isGlobalFixed(epack);
   }
 
-  public boolean validate()
+  public void check()
   {
     boolean hasFixedFormatItems = getHasFixedFormatItems(epack);
     SearchDictionary tsd = new SearchDictionary(DictionaryType.CSS_VALUES);
@@ -146,7 +146,6 @@ public class EpubCSSCheck implements DocumentValidator
     {
       report.message(MessageId.CSS_011, EPUBLocation.create(epack.getFileName()));
     }
-    return true;
   }
 
   boolean getHasFixedFormatItems(EpubPackage epack)
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubCfiCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubCfiCheck.java
index 2532c1f2..1a01a980 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubCfiCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubCfiCheck.java
@@ -4,6 +4,8 @@ import java.io.File;
 import java.util.Vector;
 import java.util.zip.ZipEntry;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
@@ -11,7 +13,6 @@ import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
 import com.adobe.epubcheck.ctc.xml.AnchorTagHandler;
 import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.SearchDictionary;
 import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
 
@@ -22,7 +23,7 @@ import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubCfiCheck implements DocumentValidator
+public class EpubCfiCheck implements Checker
 {
   private final Report report;
   private final EpubPackage epack;
@@ -34,7 +35,7 @@ public class EpubCfiCheck implements DocumentValidator
   }
 
 
-  public boolean validate()
+  public void check()
   {
     SearchDictionary validTypes = new SearchDictionary(DictionaryType.VALID_TEXT_MEDIA_TYPES);
 
@@ -64,8 +65,6 @@ public class EpubCfiCheck implements DocumentValidator
         }
       }
     }
-
-    return true;
   }
 
   private void searchInsideValue(AnchorTagHandler.DocTagContent entry, String file)
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubCheckContentFactory.java b/src/main/java/com/adobe/epubcheck/ctc/EpubCheckContentFactory.java
index 72fb8488..2be39d44 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubCheckContentFactory.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubCheckContentFactory.java
@@ -1,8 +1,9 @@
 package com.adobe.epubcheck.ctc;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
-import com.adobe.epubcheck.opf.DocumentValidator;
 
 /**
  *  ===  WARNING  ==========================================<br/>
@@ -21,7 +22,7 @@ public class EpubCheckContentFactory implements ContentValidator
   }
 
   @Override
-  public DocumentValidator newInstance(Report report, ValidationType vt, EpubPackage epack)
+  public Checker newInstance(Report report, ValidationType vt, EpubPackage epack)
   {
     if (vt.equals(ValidationType.METADATA_V3))
     {
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubExtLinksCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubExtLinksCheck.java
index 28c387d2..cfb17686 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubExtLinksCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubExtLinksCheck.java
@@ -5,6 +5,8 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.zip.ZipEntry;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
@@ -12,7 +14,6 @@ import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
 import com.adobe.epubcheck.ctc.xml.AnchorTagHandler;
 import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.PathUtil;
 import com.adobe.epubcheck.util.SearchDictionary;
 import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
@@ -25,7 +26,7 @@ import com.adobe.epubcheck.util.TextSearchDictionaryEntry;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubExtLinksCheck implements DocumentValidator
+public class EpubExtLinksCheck implements Checker
 {
   private final Report report;
   private final EpubPackage epack;
@@ -36,7 +37,7 @@ public class EpubExtLinksCheck implements DocumentValidator
     this.report = report;
   }
 
-  public boolean validate()
+  public void check()
   {
     SearchDictionary tsd = new SearchDictionary(DictionaryType.LINK_VALUES);
     SearchDictionary validTypes = new SearchDictionary(DictionaryType.VALID_TEXT_MEDIA_TYPES);
@@ -98,7 +99,6 @@ public class EpubExtLinksCheck implements DocumentValidator
         }
       }
     }
-    return true;
   }
 
   private void searchInsideValue(AnchorTagHandler.DocTagContent entry, SearchDictionary tds, String file)
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubHTML5StructureCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubHTML5StructureCheck.java
index 8b76f24f..b5a6f5e5 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubHTML5StructureCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubHTML5StructureCheck.java
@@ -9,6 +9,8 @@ import java.util.regex.Pattern;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
@@ -18,7 +20,6 @@ import com.adobe.epubcheck.ctc.xml.HTMLTagsAnalyseHandler;
 import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
 import com.adobe.epubcheck.messages.MessageId;
 import com.adobe.epubcheck.ocf.EncryptionFilter;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.EPUBVersion;
 import com.adobe.epubcheck.util.FeatureEnum;
 import com.adobe.epubcheck.util.SearchDictionary;
@@ -31,7 +32,7 @@ import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubHTML5StructureCheck implements DocumentValidator
+public class EpubHTML5StructureCheck implements Checker
 {
   static final int hasHtml = 1;
   static final int hasPublic = 2;
@@ -54,7 +55,7 @@ public class EpubHTML5StructureCheck implements DocumentValidator
   }
 
   @Override
-  public boolean validate()
+  public void check()
   {
     boolean result = false;
     SearchDictionary vtsd = new SearchDictionary(DictionaryType.VALID_TEXT_MEDIA_TYPES);
@@ -155,7 +156,6 @@ public class EpubHTML5StructureCheck implements DocumentValidator
       }
     }
 
-    return result;
   }
 
   InputStream getInputStream(String name) throws
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubLangCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubLangCheck.java
index c14196e8..a42293f6 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubLangCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubLangCheck.java
@@ -3,6 +3,8 @@ package com.adobe.epubcheck.ctc;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
@@ -10,7 +12,6 @@ import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
 import com.adobe.epubcheck.ctc.xml.LangAttributeHandler;
 import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.SearchDictionary;
 import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
 
@@ -21,7 +22,7 @@ import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubLangCheck implements DocumentValidator
+public class EpubLangCheck implements Checker
 {
   private final ZipFile zip;
   private final Report report;
@@ -35,7 +36,7 @@ public class EpubLangCheck implements DocumentValidator
   }
 
   @Override
-  public boolean validate()
+  public void check()
   {
     boolean result = false;
     SearchDictionary vtsd = new SearchDictionary(DictionaryType.VALID_TEXT_MEDIA_TYPES);
@@ -88,7 +89,6 @@ public class EpubLangCheck implements DocumentValidator
         }
       }
     }
-    return result;
   }
 
   private boolean isValidLanguageDefinition(String language)
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV2Check.java b/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV2Check.java
index b0773e3b..c1c138c2 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV2Check.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV2Check.java
@@ -1,10 +1,10 @@
 package com.adobe.epubcheck.ctc;
 
 import org.w3c.dom.Document;
+import org.w3c.epubcheck.core.Checker;
 
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
-import com.adobe.epubcheck.opf.DocumentValidator;
 
 /**
  *  ===  WARNING  ==========================================<br/>
@@ -13,7 +13,7 @@ import com.adobe.epubcheck.opf.DocumentValidator;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubMetaDataV2Check implements DocumentValidator
+public class EpubMetaDataV2Check implements Checker
 {
   private final Document doc;
   private final String pathRootFile;
@@ -28,13 +28,13 @@ public class EpubMetaDataV2Check implements DocumentValidator
   }
 
   @Override
-  public boolean validate()
+  public void check()
   {
-    return isMetaDataValid(doc, pathRootFile);
+    isMetaDataValid(doc, pathRootFile);
   }
 
-  private boolean isMetaDataValid(Document doc, String pathRootFile)
+  private void isMetaDataValid(Document doc, String pathRootFile)
   {
-    return true; // no custom checks
+    // no custom checks
   }
 }
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV3Check.java b/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV3Check.java
index e51f6fb7..078a9ea9 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV3Check.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV3Check.java
@@ -1,10 +1,10 @@
 package com.adobe.epubcheck.ctc;
 
 import org.w3c.dom.Document;
+import org.w3c.epubcheck.core.Checker;
 
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
-import com.adobe.epubcheck.opf.DocumentValidator;
 
 /**
  *  ===  WARNING  ==========================================<br/>
@@ -13,7 +13,7 @@ import com.adobe.epubcheck.opf.DocumentValidator;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubMetaDataV3Check implements DocumentValidator
+public class EpubMetaDataV3Check implements Checker
 {
 
   private final Document doc;
@@ -29,13 +29,13 @@ public class EpubMetaDataV3Check implements DocumentValidator
   }
 
   @Override
-  public boolean validate()
+  public void check()
   {
-    return isMetaDataValid(doc, pathRootFile);
+    isMetaDataValid(doc, pathRootFile);
   }
 
-  private boolean isMetaDataValid(Document doc, String pathRootFile)
+  private void isMetaDataValid(Document doc, String pathRootFile)
   {
-    return true; // no custom checks
+    // no custom checks
   }
 }
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubNCXCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubNCXCheck.java
index c7b962af..4d940f27 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubNCXCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubNCXCheck.java
@@ -7,6 +7,7 @@ import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
+import org.w3c.epubcheck.core.Checker;
 
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.Report;
@@ -16,7 +17,6 @@ import com.adobe.epubcheck.ctc.epubpackage.PackageManifest;
 import com.adobe.epubcheck.ctc.epubpackage.PackageSpine;
 import com.adobe.epubcheck.ctc.epubpackage.SpineItem;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.reporting.CheckingReport;
 import com.adobe.epubcheck.util.EPUBVersion;
 import com.adobe.epubcheck.util.EpubConstants;
@@ -30,7 +30,7 @@ import com.adobe.epubcheck.util.PathUtil;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubNCXCheck implements DocumentValidator
+public class EpubNCXCheck implements Checker
 {
   private final XmlDocParser docParser;
   private final Document doc;
@@ -50,7 +50,7 @@ public class EpubNCXCheck implements DocumentValidator
   }
 
   @Override
-  public boolean validate()
+  public void check()
   {
     boolean result = isNCXDefined(doc);
     if (result)
@@ -71,7 +71,6 @@ public class EpubNCXCheck implements DocumentValidator
       }
     }
 
-    return result;
   }
 
   private boolean isNCXDefined(Document doc)
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubNavCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubNavCheck.java
index 08332d3e..b4ba8870 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubNavCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubNavCheck.java
@@ -10,6 +10,7 @@ import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
+import org.w3c.epubcheck.core.Checker;
 
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.Report;
@@ -19,7 +20,6 @@ import com.adobe.epubcheck.ctc.epubpackage.PackageManifest;
 import com.adobe.epubcheck.ctc.epubpackage.PackageSpine;
 import com.adobe.epubcheck.ctc.epubpackage.SpineItem;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.EpubConstants;
 import com.adobe.epubcheck.util.FeatureEnum;
 import com.adobe.epubcheck.util.HandlerUtil;
@@ -32,7 +32,7 @@ import com.adobe.epubcheck.util.PathUtil;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubNavCheck implements DocumentValidator
+public class EpubNavCheck implements Checker
 {
 
   private final XmlDocParser docParser;
@@ -51,7 +51,7 @@ public class EpubNavCheck implements DocumentValidator
 
 
   @Override
-  public boolean validate()
+  public void check()
   {
     boolean result = false;
     Vector<String> navDocPath = getNAVDocuments(packageMainDocument);
@@ -84,8 +84,6 @@ public class EpubNavCheck implements DocumentValidator
         }
       }
     }
-
-    return result;
   }
 
   private Vector<String> getNAVDocuments(Document doc)
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubRenditionCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubRenditionCheck.java
index 81790729..601c2cff 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubRenditionCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubRenditionCheck.java
@@ -1,14 +1,15 @@
 package com.adobe.epubcheck.ctc;
 
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
-import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
-import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.util.FeatureEnum;
 import org.w3c.dom.Document;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
+import org.w3c.epubcheck.core.Checker;
+
+import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
+import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
+import com.adobe.epubcheck.util.FeatureEnum;
 
 /**
  *  ===  WARNING  ==========================================<br/>
@@ -17,7 +18,7 @@ import org.w3c.dom.NodeList;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubRenditionCheck implements DocumentValidator
+public class EpubRenditionCheck implements Checker
 {
   private final Document doc;
   private final EpubPackage epack;
@@ -31,12 +32,12 @@ public class EpubRenditionCheck implements DocumentValidator
   }
 
   @Override
-  public boolean validate()
+  public void check()
   {
-    return isRenditionDefined(doc);
+    isRenditionDefined(doc);
   }
 
-  private boolean isRenditionDefined(Document doc)
+  private void isRenditionDefined(Document doc)
   {
     boolean result = false;
     NodeList nList = doc.getElementsByTagName("metadata");
@@ -146,6 +147,5 @@ public class EpubRenditionCheck implements DocumentValidator
         }
       }
     }
-    return result;
   }
 }
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubSVGCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubSVGCheck.java
index 6ad510fe..b7763177 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubSVGCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubSVGCheck.java
@@ -6,6 +6,7 @@ import java.util.zip.ZipEntry;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
+import org.w3c.epubcheck.core.Checker;
 
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.Report;
@@ -13,7 +14,6 @@ import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
 import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
 import com.adobe.epubcheck.ctc.epubpackage.SpineItem;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.SearchDictionary;
 
 /**
@@ -23,7 +23,7 @@ import com.adobe.epubcheck.util.SearchDictionary;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubSVGCheck implements DocumentValidator
+public class EpubSVGCheck implements Checker
 {
   private static final String svgNS = "http://www.w3.org/2000/svg";
   private static final String xlinkNS = "http://www.w3.org/1999/xlink";
@@ -42,7 +42,7 @@ public class EpubSVGCheck implements DocumentValidator
   }
 
   @Override
-  public boolean validate()
+  public void check()
   {
     SearchDictionary validTypes = new SearchDictionary(SearchDictionary.DictionaryType.SVG_MEDIA_TYPES);
 
@@ -103,7 +103,6 @@ public class EpubSVGCheck implements DocumentValidator
         }
       }
     }
-    return true;
   }
 
   void checkSvgDoc(String svgDocEntry)
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubScriptCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubScriptCheck.java
index 82cb8acd..ee8bdbe5 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubScriptCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubScriptCheck.java
@@ -10,6 +10,8 @@ import java.util.regex.Matcher;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
@@ -18,7 +20,6 @@ import com.adobe.epubcheck.ctc.xml.ScriptTagHandler;
 import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
 import com.adobe.epubcheck.messages.MessageId;
 import com.adobe.epubcheck.opf.OPFChecker30;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.EPUBVersion;
 import com.adobe.epubcheck.util.FeatureEnum;
 import com.adobe.epubcheck.util.SearchDictionary;
@@ -31,7 +32,7 @@ import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubScriptCheck implements DocumentValidator
+public class EpubScriptCheck implements Checker
 {
   private final ZipFile zip;
   private final Report report;
@@ -45,7 +46,7 @@ public class EpubScriptCheck implements DocumentValidator
   }
 
   @Override
-  public boolean validate()
+  public void check()
   {
     boolean result = false;
     SearchDictionary vtsd = new SearchDictionary(DictionaryType.VALID_TEXT_MEDIA_TYPES);
@@ -90,7 +91,6 @@ public class EpubScriptCheck implements DocumentValidator
 
       checkJavascript(mi);
     }
-    return result;
   }
   
   void checkJavascript(ManifestItem mi)
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubSpanCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubSpanCheck.java
index 02807b77..e6f06441 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubSpanCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubSpanCheck.java
@@ -3,6 +3,8 @@ package com.adobe.epubcheck.ctc;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
@@ -10,7 +12,6 @@ import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
 import com.adobe.epubcheck.ctc.xml.SpanTagHandler;
 import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.SearchDictionary;
 import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
 
@@ -21,7 +22,7 @@ import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubSpanCheck implements DocumentValidator
+public class EpubSpanCheck implements Checker
 {
   private final ZipFile zip;
   private final Report report;
@@ -35,7 +36,7 @@ public class EpubSpanCheck implements DocumentValidator
   }
 
   @Override
-  public boolean validate()
+  public void check()
   {
     boolean result = false;
     SearchDictionary vtsd = new SearchDictionary(DictionaryType.VALID_TEXT_MEDIA_TYPES);
@@ -64,6 +65,5 @@ public class EpubSpanCheck implements DocumentValidator
         }
       }
     }
-    return result;
   }
 }
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubSpineCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubSpineCheck.java
index de3729be..c13208a5 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubSpineCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubSpineCheck.java
@@ -1,19 +1,19 @@
 package com.adobe.epubcheck.ctc;
 
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
 import com.adobe.epubcheck.ctc.epubpackage.MetadataElement;
 import com.adobe.epubcheck.ctc.epubpackage.SpineItem;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.EpubConstants;
 import com.adobe.epubcheck.util.outWriter;
 
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
 /**
  *  ===  WARNING  ==========================================<br/>
  *  This class is scheduled to be refactored and integrated<br/>
@@ -21,7 +21,7 @@ import org.w3c.dom.NodeList;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubSpineCheck implements DocumentValidator
+public class EpubSpineCheck implements Checker
 {
   private static final int MAX_SPINE_ITEM_THRESHOLD = 100;
   private final EpubPackage epubPack;
@@ -37,12 +37,10 @@ public class EpubSpineCheck implements DocumentValidator
     this.report = report;
   }
 
-  public boolean validate()
+  public void check()
   {
-    boolean resExists = isSpineDefined(doc, pathRootFile);
-    boolean resElements = tooManySpineElements(doc, pathRootFile, MAX_SPINE_ITEM_THRESHOLD);
-
-    return (resExists && resElements);
+    isSpineDefined(doc, pathRootFile);
+    tooManySpineElements(doc, pathRootFile, MAX_SPINE_ITEM_THRESHOLD);
   }
 
   private boolean isSpineDefined(Document doc, String pathRootFile)
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubStyleSheetsCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubStyleSheetsCheck.java
index 58cd7c68..bedc52c0 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubStyleSheetsCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubStyleSheetsCheck.java
@@ -2,12 +2,13 @@ package com.adobe.epubcheck.ctc;
 
 import java.util.zip.ZipEntry;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
 import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
 import com.adobe.epubcheck.ctc.xml.LinkTagHandler;
 import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.SearchDictionary;
 import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
 
@@ -18,7 +19,7 @@ import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubStyleSheetsCheck implements DocumentValidator
+public class EpubStyleSheetsCheck implements Checker
 {
   private final Report report;
   private final EpubPackage epack;
@@ -29,7 +30,7 @@ public class EpubStyleSheetsCheck implements DocumentValidator
     this.report = report;
   }
 
-  public boolean validate()
+  public void check()
   {
     SearchDictionary validTypes = new SearchDictionary(DictionaryType.VALID_TEXT_MEDIA_TYPES);
 
@@ -56,7 +57,6 @@ public class EpubStyleSheetsCheck implements DocumentValidator
         h.checkForMultipleStyleSheets(fileToParse);
       }
     }
-    return true;
   }
 }
 
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubTextContentCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubTextContentCheck.java
index 6ded0619..24ecf191 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubTextContentCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubTextContentCheck.java
@@ -4,10 +4,11 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.zip.ZipEntry;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
 import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.SearchDictionary;
 import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
 
@@ -18,7 +19,7 @@ import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubTextContentCheck implements DocumentValidator
+public class EpubTextContentCheck implements Checker
 {
   private final Report report;
   private final EpubPackage epack;
@@ -33,7 +34,7 @@ public class EpubTextContentCheck implements DocumentValidator
     this.report = report;
   }
 
-  public boolean validate()
+  public void check()
   {
     SearchDictionary validScriptTypes = new SearchDictionary(DictionaryType.VALID_TEXT_MEDIA_TYPES);
 
@@ -58,7 +59,6 @@ public class EpubTextContentCheck implements DocumentValidator
         }
       }
     }
-    return true;
   }
 
 }
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubTocCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubTocCheck.java
index fd9a8d99..c1b7fb9c 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubTocCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubTocCheck.java
@@ -1,11 +1,12 @@
 package com.adobe.epubcheck.ctc;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
 import com.adobe.epubcheck.ctc.epubpackage.PackageSpine;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.opf.DocumentValidator;
 import com.adobe.epubcheck.util.EPUBVersion;
 
 /**
@@ -15,7 +16,7 @@ import com.adobe.epubcheck.util.EPUBVersion;
  *  Please keep changes minimal (bug fixes only) until then.<br/>
  *  ========================================================<br/>
  */
-public class EpubTocCheck implements DocumentValidator
+public class EpubTocCheck implements Checker
 {
   private final String pathRootFile;
   private final EpubPackage epack;
@@ -29,7 +30,7 @@ public class EpubTocCheck implements DocumentValidator
   }
 
   @Override
-  public boolean validate()
+  public void check()
   {
     boolean result = true;
     PackageSpine spine = epack.getSpine();
@@ -38,6 +39,5 @@ public class EpubTocCheck implements DocumentValidator
       report.message(MessageId.NCX_002, EPUBLocation.create(pathRootFile));
       result = false;
     }
-    return result;
   }
 }
diff --git a/src/main/java/com/adobe/epubcheck/dict/SearchKeyMapChecker.java b/src/main/java/com/adobe/epubcheck/dict/SearchKeyMapChecker.java
index e8325693..bd70785c 100644
--- a/src/main/java/com/adobe/epubcheck/dict/SearchKeyMapChecker.java
+++ b/src/main/java/com/adobe/epubcheck/dict/SearchKeyMapChecker.java
@@ -23,65 +23,38 @@
 package com.adobe.epubcheck.dict;
 
 import com.adobe.epubcheck.api.EPUBLocation;
-import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.ocf.OCFPackage;
-import com.adobe.epubcheck.opf.ContentChecker;
-import com.adobe.epubcheck.opf.DocumentValidator;
+import com.adobe.epubcheck.opf.PublicationResourceChecker;
 import com.adobe.epubcheck.opf.ValidationContext;
 import com.adobe.epubcheck.xml.XMLParser;
 import com.adobe.epubcheck.xml.XMLValidators;
 import com.google.common.base.Preconditions;
 
-public class SearchKeyMapChecker implements ContentChecker, DocumentValidator
+public class SearchKeyMapChecker extends  PublicationResourceChecker
 {
 
-  private final ValidationContext context;
-  private final Report report;
-  private final String path;
 
   public SearchKeyMapChecker(ValidationContext context)
   {
+    super(context);
     Preconditions.checkState("application/vnd.epub.search-key-map+xml".equals(context.mimeType));
-    this.context = context;
-    this.report = context.report;
-    this.path = context.path;
   }
 
-  public void runChecks()
+  @Override
+  protected boolean checkContent()
   {
-    OCFPackage ocf = context.ocf.get();
-    if (!ocf.hasEntry(path))
+    // File check
+    if (!context.path.endsWith(".xml"))
     {
-      report.message(MessageId.RSC_001, EPUBLocation.create(ocf.getName()), path);
+      report.message(MessageId.OPF_080, EPUBLocation.create(context.path));
     }
-    else if (!ocf.canDecrypt(path))
-    {
-      report.message(MessageId.RSC_004, EPUBLocation.create(ocf.getName()), path);
-    }
-    else if (!path.endsWith(".xml"))
-    {
-      report.message(MessageId.OPF_080, EPUBLocation.create(path));
-    }
-    else
-    {
-      validate();
-    }
-  }
-
-  public boolean validate()
-  {
-    int fatalErrorsSoFar = report.getFatalErrorCount();
-    int errorsSoFar = report.getErrorCount();
-    int warningsSoFar = report.getWarningCount();
+    // Content checks
     SearchKeyMapHandler handler;
     XMLParser parser = new XMLParser(context);
     handler = new SearchKeyMapHandler(context, parser);
     parser.addValidator(XMLValidators.SEARCH_KEY_MAP_RNC.get());
     parser.addXMLHandler(handler);
     parser.process();
-
-    return fatalErrorsSoFar == report.getFatalErrorCount() && errorsSoFar == report.getErrorCount()
-        && warningsSoFar == report.getWarningCount();
+    return true;
   }
 }
diff --git a/src/main/java/com/adobe/epubcheck/dict/SearchKeyMapCheckerFactory.java b/src/main/java/com/adobe/epubcheck/dict/SearchKeyMapCheckerFactory.java
deleted file mode 100644
index fb716588..00000000
--- a/src/main/java/com/adobe/epubcheck/dict/SearchKeyMapCheckerFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2011 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.dict;
-
-import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.DocumentValidatorFactory;
-import com.adobe.epubcheck.opf.ValidationContext;
-
-public class SearchKeyMapCheckerFactory implements ContentCheckerFactory, DocumentValidatorFactory
-{
-  static private final SearchKeyMapCheckerFactory instance = new SearchKeyMapCheckerFactory();
-
-  public SearchKeyMapChecker newInstance(ValidationContext context)
-  {
-    return new SearchKeyMapChecker(context);
-  }
-
-  static public SearchKeyMapCheckerFactory getInstance()
-  {
-    return instance;
-  }
-
-}
diff --git a/src/main/java/com/adobe/epubcheck/dtbook/DTBookChecker.java b/src/main/java/com/adobe/epubcheck/dtbook/DTBookChecker.java
index edd27e2b..c774b11a 100755
--- a/src/main/java/com/adobe/epubcheck/dtbook/DTBookChecker.java
+++ b/src/main/java/com/adobe/epubcheck/dtbook/DTBookChecker.java
@@ -22,49 +22,30 @@
 
 package com.adobe.epubcheck.dtbook;
 
-import com.adobe.epubcheck.api.EPUBLocation;
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.ocf.OCFPackage;
-import com.adobe.epubcheck.opf.ContentChecker;
+import com.adobe.epubcheck.opf.PublicationResourceChecker;
 import com.adobe.epubcheck.opf.ValidationContext;
 import com.adobe.epubcheck.xml.XMLParser;
 import com.adobe.epubcheck.xml.XMLValidators;
 import com.google.common.base.Preconditions;
 
-public class DTBookChecker implements ContentChecker
+public class DTBookChecker extends  PublicationResourceChecker
 {
 
-  private final ValidationContext context;
-  private final Report report;
-  private final String path;
 
   public DTBookChecker(ValidationContext context)
   {
+    super(context);
     Preconditions.checkState("application/x-dtbook+xml".equals(context.mimeType));
-    this.context = context;
-    this.report = context.report;
-    this.path = context.path;
   }
 
-  public void runChecks()
+  @Override
+  protected boolean checkContent()
   {
-    OCFPackage ocf = context.ocf.get();
-    if (!ocf.hasEntry(path))
-    {
-      report.message(MessageId.RSC_001, EPUBLocation.create(ocf.getName()), path);
-    }
-    else if (!ocf.canDecrypt(path))
-    {
-      report.message(MessageId.RSC_004, EPUBLocation.create(ocf.getName()), path);
-    }
-    else
-    {
-      XMLParser dtbookParser = new XMLParser(context);
-      dtbookParser.addValidator(XMLValidators.DTBOOK_RNG.get());
-      DTBookHandler dtbookHandler = new DTBookHandler(dtbookParser, path, context.xrefChecker.get());
-      dtbookParser.addXMLHandler(dtbookHandler);
-      dtbookParser.process();
-    }
+    XMLParser dtbookParser = new XMLParser(context);
+    dtbookParser.addValidator(XMLValidators.DTBOOK_RNG.get());
+    DTBookHandler dtbookHandler = new DTBookHandler(dtbookParser, context.path, context.xrefChecker.get());
+    dtbookParser.addXMLHandler(dtbookHandler);
+    dtbookParser.process();
+    return true;
   }
 }
diff --git a/src/main/java/com/adobe/epubcheck/dtbook/DTBookCheckerFactory.java b/src/main/java/com/adobe/epubcheck/dtbook/DTBookCheckerFactory.java
deleted file mode 100755
index a8c80eb2..00000000
--- a/src/main/java/com/adobe/epubcheck/dtbook/DTBookCheckerFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2007 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.dtbook;
-
-import com.adobe.epubcheck.opf.ContentChecker;
-import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.ValidationContext;
-
-public class DTBookCheckerFactory implements ContentCheckerFactory
-{
-  public ContentChecker newInstance(ValidationContext context)
-  {
-    return new DTBookChecker(context);
-  }
-
-  static private final DTBookCheckerFactory instance = new DTBookCheckerFactory();
-
-  static public DTBookCheckerFactory getInstance()
-  {
-    return instance;
-  }
-}
diff --git a/src/main/java/com/adobe/epubcheck/nav/NavChecker.java b/src/main/java/com/adobe/epubcheck/nav/NavChecker.java
index a6552589..a7d7fffb 100644
--- a/src/main/java/com/adobe/epubcheck/nav/NavChecker.java
+++ b/src/main/java/com/adobe/epubcheck/nav/NavChecker.java
@@ -22,15 +22,19 @@
 
 package com.adobe.epubcheck.nav;
 
-import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.*;
-import static com.google.common.base.Predicates.*;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.hasProp;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.hasPubType;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.mimetype;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.profile;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.version;
+import static com.google.common.base.Predicates.and;
+import static com.google.common.base.Predicates.not;
+import static com.google.common.base.Predicates.or;
 
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.EPUBProfile;
-import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.opf.ContentChecker;
-import com.adobe.epubcheck.opf.DocumentValidator;
+import com.adobe.epubcheck.opf.PublicationResourceChecker;
 import com.adobe.epubcheck.opf.OPFData;
 import com.adobe.epubcheck.opf.ValidationContext;
 import com.adobe.epubcheck.util.EPUBVersion;
@@ -44,10 +48,9 @@ import com.adobe.epubcheck.xml.XMLValidators;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Predicates;
 
-public class NavChecker implements ContentChecker, DocumentValidator
+public class NavChecker extends PublicationResourceChecker
 {
 
-  @SuppressWarnings("unchecked")
   private final static ValidatorMap validatorMap = ValidatorMap.builder()
       .putAll(XMLValidators.NAV_30_RNC, XMLValidators.XHTML_30_SCH, XMLValidators.NAV_30_SCH)
       .putAll(
@@ -67,46 +70,22 @@ public class NavChecker implements ContentChecker, DocumentValidator
           XMLValidators.XHTML_IDX_SCH, XMLValidators.XHTML_IDX_INDEX_SCH)
       .build();
 
-  private final ValidationContext context;
-  private final Report report;
-  private final String path;
 
   public NavChecker(ValidationContext context)
   {
+    super(context);
     Preconditions.checkState("application/xhtml+xml".equals(context.mimeType));
-    this.context = context;
-    this.report = context.report;
-    this.path = context.path;
     if (context.version == EPUBVersion.VERSION_2)
     {
-      context.report.message(MessageId.NAV_001, EPUBLocation.create(path));
+      context.report.message(MessageId.NAV_001, EPUBLocation.create(context.path));
     }
   }
 
   @Override
-  public void runChecks()
+  protected boolean checkContent()
   {
-    if (!context.ocf.get().hasEntry(path))
-    {
-      report.message(MessageId.RSC_001, EPUBLocation.create(context.ocf.get().getName()), path);
-    }
-    else if (!context.ocf.get().canDecrypt(path))
-    {
-      report.message(MessageId.RSC_004, EPUBLocation.create(context.ocf.get().getName()), path);
-    }
-    else
-    {
-      validate();
-    }
-  }
-
-  public boolean validate()
-  {
-    int fatalErrors = report.getFatalErrorCount();
-    int errors = report.getErrorCount();
-    int warnings = report.getWarningCount();
     XMLParser navParser = new XMLParser(context);
-
+    
     XMLHandler navHandler = new NavHandler(context, navParser);
     navParser.addXMLHandler(navHandler);
     for (XMLValidator validator : validatorMap.getValidators(context))
@@ -114,8 +93,7 @@ public class NavChecker implements ContentChecker, DocumentValidator
       navParser.addValidator(validator);
     }
     navParser.process();
-
-    return ((fatalErrors == report.getFatalErrorCount()) && (errors == report.getErrorCount())
-        && (warnings == report.getWarningCount()));
+    return true;
   }
+
 }
diff --git a/src/main/java/com/adobe/epubcheck/nav/NavCheckerFactory.java b/src/main/java/com/adobe/epubcheck/nav/NavCheckerFactory.java
deleted file mode 100644
index e74f65b7..00000000
--- a/src/main/java/com/adobe/epubcheck/nav/NavCheckerFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2011 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.nav;
-
-import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.DocumentValidatorFactory;
-import com.adobe.epubcheck.opf.ValidationContext;
-
-public class NavCheckerFactory implements ContentCheckerFactory, DocumentValidatorFactory
-{
-  static private final NavCheckerFactory instance = new NavCheckerFactory();
-
-  public NavChecker newInstance(ValidationContext context)
-  {
-    return new NavChecker(context);
-  }
-
-  static public NavCheckerFactory getInstance()
-  {
-    return instance;
-  }
-
-}
diff --git a/src/main/java/com/adobe/epubcheck/ncx/NCXChecker.java b/src/main/java/com/adobe/epubcheck/ncx/NCXChecker.java
index 357e3fa3..256ff3fd 100755
--- a/src/main/java/com/adobe/epubcheck/ncx/NCXChecker.java
+++ b/src/main/java/com/adobe/epubcheck/ncx/NCXChecker.java
@@ -23,65 +23,56 @@
 package com.adobe.epubcheck.ncx;
 
 import com.adobe.epubcheck.api.EPUBLocation;
-import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.ocf.OCFPackage;
-import com.adobe.epubcheck.opf.ContentChecker;
+import com.adobe.epubcheck.opf.PublicationResourceChecker;
 import com.adobe.epubcheck.opf.ValidationContext;
 import com.adobe.epubcheck.xml.XMLParser;
 import com.adobe.epubcheck.xml.XMLValidators;
 import com.google.common.base.Preconditions;
 
-public class NCXChecker implements ContentChecker
+public class NCXChecker extends PublicationResourceChecker
 {
-  private final ValidationContext context;
-  private final Report report;
-  private final String path;
+  
+  private String ncxId = null;
 
   public NCXChecker(ValidationContext context)
   {
+    super(context);
     Preconditions.checkState("application/x-dtbncx+xml".equals(context.mimeType));
-    this.context = context;
-    this.report = context.report;
-    this.path = context.path;
   }
 
-  public void runChecks()
-  {
-    OCFPackage ocf = context.ocf.get();
-    if (!ocf.hasEntry(path))
-    {
-      report.message(MessageId.RSC_001, EPUBLocation.create(ocf.getName()), path);
-    }
-    else if (!ocf.canDecrypt(path))
+  @Override
+  protected boolean checkContent()
+  { 
+    // relaxng
+    XMLParser ncxParser;
+    NCXHandler ncxHandler;
+
+    ncxParser = new XMLParser(context);
+    ncxParser.addValidator(XMLValidators.NCX_RNG.get());
+    ncxParser.addValidator(XMLValidators.NCX_SCH.get());
+    ncxHandler = new NCXHandler(ncxParser, context.path, context.xrefChecker.get());
+    ncxParser.addXMLHandler(ncxHandler);
+    ncxParser.process();
+
+    // report this for EPUB2 and ALSO for EPUB3 (see discussion in #669)
+    ncxId = ncxHandler.getUid();
+    if (ncxId != null && !ncxId.equals(ncxId.trim()))
     {
-      report.message(MessageId.RSC_004, EPUBLocation.create(ocf.getName()), path);
+      report.message(MessageId.NCX_004, EPUBLocation.create(context.path));
     }
-    else
+    return true;
+  }
+  
+  @Override
+  protected boolean checkPublicationAfterContent() {
+    // Check that the ID matches the OPF’s ID
+    // TODO improve way to get this EPUB 2's single OPF
+    String uid = context.ocf.get().getOpfData().values().iterator().next().getUniqueIdentifier();
+    if (uid != null && ncxId != null && !uid.equals(ncxId.trim()))
     {
-      // relaxng
-      XMLParser ncxParser;
-      NCXHandler ncxHandler;
-
-      ncxParser = new XMLParser(context);
-      ncxParser.addValidator(XMLValidators.NCX_RNG.get());
-      ncxParser.addValidator(XMLValidators.NCX_SCH.get());
-      ncxHandler = new NCXHandler(ncxParser, path, context.xrefChecker.get());
-      ncxParser.addXMLHandler(ncxHandler);
-      ncxParser.process();
-
-      // report this for EPUB2 and ALSO for EPUB3 (see discussion in #669)
-      String ncxId = ncxHandler.getUid();
-      if (ncxId != null && !ncxId.equals(ncxId.trim()))
-      {
-        report.message(MessageId.NCX_004, ncxParser.getLocation());
-      }
-      // FIXME improve way to get this EPUB 2's single OPF
-      String uid = ocf.getOpfData().values().iterator().next().getUniqueIdentifier();
-      if (uid != null && ncxId != null && !uid.equals(ncxId.trim()))
-      {
-        report.message(MessageId.NCX_001, ncxParser.getLocation(), ncxHandler.getUid(), uid);
-      }
+      report.message(MessageId.NCX_001, EPUBLocation.create(context.path), ncxId, uid);
     }
+    return true;
   }
 }
diff --git a/src/main/java/com/adobe/epubcheck/ncx/NCXCheckerFactory.java b/src/main/java/com/adobe/epubcheck/ncx/NCXCheckerFactory.java
deleted file mode 100755
index 99a9eb4e..00000000
--- a/src/main/java/com/adobe/epubcheck/ncx/NCXCheckerFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2007 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.ncx;
-
-import com.adobe.epubcheck.opf.ContentChecker;
-import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.ValidationContext;
-
-public class NCXCheckerFactory implements ContentCheckerFactory
-{
-  static private final NCXCheckerFactory instance = new NCXCheckerFactory();
-
-  public ContentChecker newInstance(ValidationContext context)
-  {
-    return new NCXChecker(context);
-  }
-
-  static public NCXCheckerFactory getInstance()
-  {
-    return instance;
-  }
-}
diff --git a/src/main/java/com/adobe/epubcheck/ocf/OCFChecker.java b/src/main/java/com/adobe/epubcheck/ocf/OCFChecker.java
index 967e3475..b5639cec 100755
--- a/src/main/java/com/adobe/epubcheck/ocf/OCFChecker.java
+++ b/src/main/java/com/adobe/epubcheck/ocf/OCFChecker.java
@@ -22,7 +22,10 @@
 
 package com.adobe.epubcheck.ocf;
 
-import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.*;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.hasProp;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.path;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.profile;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.version;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -38,13 +41,16 @@ import java.util.List;
 import java.util.Locale;
 import java.util.Set;
 
+import org.w3c.epubcheck.constants.MIMEType;
+import org.w3c.epubcheck.core.Checker;
+import org.w3c.epubcheck.core.CheckerFactory;
+
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.EPUBProfile;
 import com.adobe.epubcheck.api.FeatureReport;
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.messages.MessageId;
 import com.adobe.epubcheck.opf.OPFChecker;
-import com.adobe.epubcheck.opf.OPFCheckerFactory;
 import com.adobe.epubcheck.opf.OPFData;
 import com.adobe.epubcheck.opf.OPFHandler;
 import com.adobe.epubcheck.opf.OPFHandler30;
@@ -63,7 +69,7 @@ import com.google.common.base.Predicate;
 import com.google.common.base.Predicates;
 import com.google.common.collect.Iterables;
 
-public class OCFChecker
+public class OCFChecker implements Checker
 {
 
   private static final ValidatorMap validatorMap = ValidatorMap.builder()
@@ -106,7 +112,7 @@ public class OCFChecker
     this.report = context.report;
   }
 
-  public void runChecks()
+  public void check()
   {
     // Create a new validation context builder from the parent context
     // It will be augmented with detected validation version, profile, etc.
@@ -132,7 +138,7 @@ public class OCFChecker
     OCFData containerData = ocf.getOcfData();
 
     // retrieve the paths of root files
-    List<String> opfPaths = containerData.getEntries(OPFData.OPF_MIME_TYPE);
+    List<String> opfPaths = containerData.getEntries(MIMEType.PACKAGE_DOC.toString());
     if (opfPaths == null || opfPaths.isEmpty())
     {
       checkZipHeader(); // run ZIP header checks in any case before returning
@@ -309,11 +315,12 @@ public class OCFChecker
     List<OPFHandler> opfHandlers = new LinkedList<OPFHandler>();
     for (String opfPath : opfPaths)
     {
-      OPFChecker opfChecker = OPFCheckerFactory.getInstance()
-          .newInstance(newContextBuilder.path(opfPath).mimetype(OPFData.OPF_MIME_TYPE)
-              .featureReport(new FeatureReport()).build());
-      opfChecker.runChecks();
-      opfHandlers.add(opfChecker.getOPFHandler());
+      ValidationContext opfContext = newContextBuilder.path(opfPath).mimetype(MIMEType.PACKAGE_DOC.toString())
+          .featureReport(new FeatureReport()).build();
+      Checker opfChecker = CheckerFactory.newChecker(opfContext);
+      assert opfChecker instanceof OPFChecker;
+      opfChecker.check();
+      opfHandlers.add(((OPFChecker)opfChecker).getOPFHandler());
     }
 
     //
diff --git a/src/main/java/com/adobe/epubcheck/ocf/OCFPackage.java b/src/main/java/com/adobe/epubcheck/ocf/OCFPackage.java
index 6ee0b189..6821d90a 100644
--- a/src/main/java/com/adobe/epubcheck/ocf/OCFPackage.java
+++ b/src/main/java/com/adobe/epubcheck/ocf/OCFPackage.java
@@ -9,6 +9,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.w3c.epubcheck.constants.MIMEType;
+
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.messages.MessageId;
@@ -51,7 +53,7 @@ public abstract class OCFPackage implements GenericResourceProvider
         {
           Preconditions.checkNotNull(reporter);
           Map<String, OPFData> result = new HashMap<String, OPFData>();
-          for (String opfPath : ocfData.get().getEntries(OPFData.OPF_MIME_TYPE))
+          for (String opfPath : ocfData.get().getEntries(MIMEType.PACKAGE_DOC.toString()))
           {
             OPFPeeker peeker = new OPFPeeker(opfPath, reporter, OCFPackage.this);
             try
diff --git a/src/main/java/com/adobe/epubcheck/opf/ContentChecker.java b/src/main/java/com/adobe/epubcheck/opf/ContentChecker.java
deleted file mode 100755
index 3e5b84fe..00000000
--- a/src/main/java/com/adobe/epubcheck/opf/ContentChecker.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2007 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.opf;
-
-public interface ContentChecker
-{
-  public void runChecks();
-}
diff --git a/src/main/java/com/adobe/epubcheck/opf/ContentCheckerFactory.java b/src/main/java/com/adobe/epubcheck/opf/ContentCheckerFactory.java
deleted file mode 100755
index 5645fc02..00000000
--- a/src/main/java/com/adobe/epubcheck/opf/ContentCheckerFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2007 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.opf;
-
-
-public interface ContentCheckerFactory
-{
-  public ContentChecker newInstance(ValidationContext context);
-}
diff --git a/src/main/java/com/adobe/epubcheck/opf/DocumentValidator.java b/src/main/java/com/adobe/epubcheck/opf/DocumentValidator.java
deleted file mode 100644
index 38dad710..00000000
--- a/src/main/java/com/adobe/epubcheck/opf/DocumentValidator.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2011 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.opf;
-
-public interface DocumentValidator
-{
-  public boolean validate();
-}
diff --git a/src/main/java/com/adobe/epubcheck/opf/DocumentValidatorFactory.java b/src/main/java/com/adobe/epubcheck/opf/DocumentValidatorFactory.java
deleted file mode 100644
index bd0e7793..00000000
--- a/src/main/java/com/adobe/epubcheck/opf/DocumentValidatorFactory.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2011 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.opf;
-
-import com.adobe.epubcheck.api.EPUBProfile;
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.GenericResourceProvider;
-
-public interface DocumentValidatorFactory
-{
-  public DocumentValidator newInstance(ValidationContext context);
-//  public DocumentValidator newInstance(Report report, String path,
-//      GenericResourceProvider resourceProvider, String mimeType,
-//      EPUBVersion version, EPUBProfile profile);
-}
diff --git a/src/main/java/com/adobe/epubcheck/opf/GenericContentChecker.java b/src/main/java/com/adobe/epubcheck/opf/GenericContentChecker.java
deleted file mode 100755
index 03f5cc5d..00000000
--- a/src/main/java/com/adobe/epubcheck/opf/GenericContentChecker.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2007 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.opf;
-
-import com.adobe.epubcheck.api.EPUBLocation;
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.ocf.OCFPackage;
-
-public class GenericContentChecker implements ContentChecker
-{
-  private final OCFPackage ocf;
-  private final Report report;
-  private final String path;
-
-  GenericContentChecker(OCFPackage ocf, Report report, String path)
-  {
-    this.ocf = ocf;
-    this.report = report;
-    this.path = path;
-  }
-
-  public void runChecks()
-  {
-    if (!ocf.hasEntry(path))
-    {
-      report.message(MessageId.RSC_001, EPUBLocation.create(this.ocf.getName()), path);
-    }
-    else if (!ocf.canDecrypt(path))
-    {
-      report.message(MessageId.RSC_004, EPUBLocation.create(this.ocf.getName()), path);
-    }
-  }
-}
diff --git a/src/main/java/com/adobe/epubcheck/opf/GenericContentCheckerFactory.java b/src/main/java/com/adobe/epubcheck/opf/GenericContentCheckerFactory.java
deleted file mode 100755
index 17edc3ae..00000000
--- a/src/main/java/com/adobe/epubcheck/opf/GenericContentCheckerFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2007 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.opf;
-
-public class GenericContentCheckerFactory implements ContentCheckerFactory
-{
-  static private final GenericContentCheckerFactory instance = new GenericContentCheckerFactory();
-
-  public ContentChecker newInstance(ValidationContext context)
-  {
-    return new GenericContentChecker(context.ocf.get(), context.report, context.path);
-  }
-
-  static public GenericContentCheckerFactory getInstance()
-  {
-    return instance;
-  }
-}
diff --git a/src/main/java/com/adobe/epubcheck/opf/OPFChecker.java b/src/main/java/com/adobe/epubcheck/opf/OPFChecker.java
index 2fa13585..66102c3b 100755
--- a/src/main/java/com/adobe/epubcheck/opf/OPFChecker.java
+++ b/src/main/java/com/adobe/epubcheck/opf/OPFChecker.java
@@ -22,27 +22,27 @@
 
 package com.adobe.epubcheck.opf;
 
-import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.*;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.hasPubType;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.profile;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.version;
 
 import java.util.HashSet;
-import java.util.Hashtable;
 import java.util.List;
 import java.util.Locale;
 import java.util.Set;
 
+import org.w3c.epubcheck.core.Checker;
+import org.w3c.epubcheck.core.CheckerFactory;
+
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.EPUBProfile;
 import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.bitmap.BitmapCheckerFactory;
-import com.adobe.epubcheck.css.CSSCheckerFactory;
-import com.adobe.epubcheck.dtbook.DTBookCheckerFactory;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.nav.NavCheckerFactory;
-import com.adobe.epubcheck.ncx.NCXCheckerFactory;
+import com.adobe.epubcheck.nav.NavChecker;
+import com.adobe.epubcheck.ncx.NCXChecker;
 import com.adobe.epubcheck.ocf.OCFFilenameChecker;
 import com.adobe.epubcheck.ocf.OCFPackage;
 import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
-import com.adobe.epubcheck.ops.OPSCheckerFactory;
 import com.adobe.epubcheck.overlay.OverlayTextChecker;
 import com.adobe.epubcheck.util.EPUBVersion;
 import com.adobe.epubcheck.util.FeatureEnum;
@@ -54,7 +54,7 @@ import com.adobe.epubcheck.xml.XMLValidators;
 import com.google.common.base.Optional;
 import com.google.common.base.Predicates;
 
-public class OPFChecker implements DocumentValidator, ContentChecker
+public class OPFChecker implements Checker
 {
 
   private final static ValidatorMap validatorMap = ValidatorMap.builder()
@@ -81,23 +81,6 @@ public class OPFChecker implements DocumentValidator, ContentChecker
   protected final EPUBVersion version;
   protected OPFHandler opfHandler = null;
   protected XMLParser opfParser = null;
-  protected final Hashtable<String, ContentCheckerFactory> contentCheckerFactoryMap = new Hashtable<String, ContentCheckerFactory>();
-
-  protected void initContentCheckerFactoryMap()
-  {
-    Hashtable<String, ContentCheckerFactory> map = new Hashtable<String, ContentCheckerFactory>();
-    map.put("application/xhtml+xml", OPSCheckerFactory.getInstance());
-    map.put("application/x-dtbook+xml", DTBookCheckerFactory.getInstance());
-    map.put("image/jpeg", BitmapCheckerFactory.getInstance());
-    map.put("image/gif", BitmapCheckerFactory.getInstance());
-    map.put("image/png", BitmapCheckerFactory.getInstance());
-    map.put("image/svg+xml", OPSCheckerFactory.getInstance());
-    map.put("text/css", CSSCheckerFactory.getInstance());
-    map.put("text/html", OPSCheckerFactory.getInstance());
-    map.put("text/x-oeb1-document", OPSCheckerFactory.getInstance());
-
-    contentCheckerFactoryMap.putAll(map);
-  }
 
   public OPFChecker(ValidationContext context)
   {
@@ -119,20 +102,26 @@ public class OPFChecker implements DocumentValidator, ContentChecker
     }
     this.context = newContext.build();
 
-    // Initialize validators and factories
-    initContentCheckerFactoryMap();
+  }
+  
+  public void check() {
+    if (context.ocf.isPresent()) {
+      checkPackage();
+    } else {
+      checkContent();
+    }
   }
 
-  public void runChecks()
+  protected boolean checkPackage()
   {
     OCFPackage ocf = context.ocf.get();
     XRefChecker xrefChecker = context.xrefChecker.get();
     if (!ocf.hasEntry(path))
     {
       report.message(MessageId.PKG_020, EPUBLocation.create(ocf.getName()), path);
-      return;
+      return false;
     }
-    validate();
+    checkContent();
 
     if (!opfHandler.checkUniqueIdentExists())
     {
@@ -169,6 +158,7 @@ public class OPFChecker implements DocumentValidator, ContentChecker
     }
 
     xrefChecker.checkReferences();
+    return false;
   }
   
   protected void checkItemAfterResourceValidation(OPFItem item) {
@@ -213,13 +203,8 @@ public class OPFChecker implements DocumentValidator, ContentChecker
     return opfHandler;
   }
 
-  @Override
-  public boolean validate()
+  protected boolean checkContent()
   {
-    int fatalErrorsSoFar = report.getFatalErrorCount();
-    int errorsSoFar = report.getErrorCount();
-    int warningsSoFar = report.getWarningCount();
-
     opfParser = new XMLParser(new ValidationContextBuilder(context).mimetype("opf").build());
     initHandler();
     opfParser.addXMLHandler(opfHandler);
@@ -291,9 +276,7 @@ public class OPFChecker implements DocumentValidator, ContentChecker
         }
       }
     }
-
-    return fatalErrorsSoFar == report.getFatalErrorCount() && errorsSoFar == report.getErrorCount()
-        && warningsSoFar == report.getWarningCount();
+    return true;
   }
 
   public static boolean isBlessedItemType(String type, EPUBVersion version)
@@ -428,36 +411,28 @@ public class OPFChecker implements DocumentValidator, ContentChecker
 
   protected void checkItemContent(OPFItem item)
   {
-    String mimetype = item.getMimeType();
-    ContentCheckerFactory checkerFactory;
-    if (item.isNcx())
-    {
-      checkerFactory = NCXCheckerFactory.getInstance();
-    }
-    else if (item.isNav())
-    {
-      checkerFactory = NavCheckerFactory.getInstance();
-    }
-    else
-    {
-      checkerFactory = contentCheckerFactoryMap.get(mimetype);
-    }
-
-    if (checkerFactory == null)
-    {
-      checkerFactory = GenericContentCheckerFactory.getInstance();
-    }
-    if (checkerFactory != null)
-    {
-      try {
-        // Create the content checker with an overridden validation context
-        ContentChecker checker = checkerFactory.newInstance(new ValidationContextBuilder(context)
-            .path(item.getPath()).mimetype(mimetype).properties(item.getProperties()).build());
-        // Validate
-        checker.runChecks();
-      } catch (IllegalStateException e) {
-        report.message(MessageId.CHK_008, EPUBLocation.create(path), item.getPath());
+    // Create a new validation context for the OPF item
+    ValidationContext itemContext = new ValidationContextBuilder(context)
+        .path(item.getPath()).mimetype(item.getMimeType()).properties(item.getProperties()).build();
+    // Create an appropriate checker
+    try {
+      Checker checker;
+      if (item.isNcx())
+      {
+        checker = new NCXChecker(itemContext);
+      }
+      else if (item.isNav())
+      {
+        checker = new NavChecker(itemContext);
+      }
+      else
+      {
+        checker = CheckerFactory.newChecker(itemContext);
       }
+      // Check the item
+      checker.check();
+    } catch (IllegalStateException e) {
+      report.message(MessageId.CHK_008, EPUBLocation.create(path), item.getPath());
     }
   }
 
diff --git a/src/main/java/com/adobe/epubcheck/opf/OPFChecker30.java b/src/main/java/com/adobe/epubcheck/opf/OPFChecker30.java
index c3efaa47..8f7f27e1 100644
--- a/src/main/java/com/adobe/epubcheck/opf/OPFChecker30.java
+++ b/src/main/java/com/adobe/epubcheck/opf/OPFChecker30.java
@@ -24,22 +24,15 @@ package com.adobe.epubcheck.opf;
 
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Set;
 
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.EPUBProfile;
 import com.adobe.epubcheck.api.FeatureReport.Feature;
-import com.adobe.epubcheck.bitmap.BitmapCheckerFactory;
-import com.adobe.epubcheck.css.CSSCheckerFactory;
-import com.adobe.epubcheck.dict.SearchKeyMapCheckerFactory;
-import com.adobe.epubcheck.dtbook.DTBookCheckerFactory;
 import com.adobe.epubcheck.messages.MessageId;
 import com.adobe.epubcheck.opf.MetadataSet.Metadata;
 import com.adobe.epubcheck.opf.ResourceCollection.Roles;
-import com.adobe.epubcheck.ops.OPSCheckerFactory;
-import com.adobe.epubcheck.overlay.OverlayCheckerFactory;
 import com.adobe.epubcheck.overlay.OverlayTextChecker;
 import com.adobe.epubcheck.util.EPUBVersion;
 import com.adobe.epubcheck.util.FeatureEnum;
@@ -52,7 +45,7 @@ import com.google.common.base.Strings;
 import com.google.common.collect.Iterables;
 import com.google.common.io.Files;
 
-public class OPFChecker30 extends OPFChecker implements DocumentValidator
+public class OPFChecker30 extends OPFChecker
 {
 
   public OPFChecker30(ValidationContext context)
@@ -60,23 +53,6 @@ public class OPFChecker30 extends OPFChecker implements DocumentValidator
     super(context);
   }
 
-  @Override
-  protected void initContentCheckerFactoryMap()
-  {
-    HashMap<String, ContentCheckerFactory> map = new HashMap<String, ContentCheckerFactory>();
-    map.put("application/vnd.epub.search-key-map+xml", SearchKeyMapCheckerFactory.getInstance());
-    map.put("application/smil+xml", OverlayCheckerFactory.getInstance());
-    map.put("application/xhtml+xml", OPSCheckerFactory.getInstance());
-    map.put("application/x-dtbook+xml", DTBookCheckerFactory.getInstance());
-    map.put("image/jpeg", BitmapCheckerFactory.getInstance());
-    map.put("image/gif", BitmapCheckerFactory.getInstance());
-    map.put("image/png", BitmapCheckerFactory.getInstance());
-    map.put("image/svg+xml", OPSCheckerFactory.getInstance());
-    map.put("text/css", CSSCheckerFactory.getInstance());
-    contentCheckerFactoryMap.clear();
-    contentCheckerFactoryMap.putAll(map);
-  }
-
   @Override
   public void initHandler()
   {
@@ -84,29 +60,24 @@ public class OPFChecker30 extends OPFChecker implements DocumentValidator
   }
 
   @Override
-  public void runChecks()
+  protected boolean checkPackage()
   {
-    super.runChecks();
+    super.checkPackage();
     checkCollectionsContent();
     checkPagination();
     checkSemantics();
     checkNav();
     checkSpecifics();
+    return false;
   }
 
   @Override
-  public boolean validate()
+  protected boolean checkContent()
   {
-    int fatalErrorsSoFar = report.getFatalErrorCount();
-    int errorsSoFar = report.getErrorCount();
-    int warningsSoFar = report.getWarningCount();
-
-    super.validate();
+    super.checkContent();
     checkLinkedResources();
     checkCollections();
-
-    return fatalErrorsSoFar == report.getFatalErrorCount() && errorsSoFar == report.getErrorCount()
-        && warningsSoFar == report.getWarningCount();
+    return true;
   }
 
   @Override
diff --git a/src/main/java/com/adobe/epubcheck/opf/OPFCheckerFactory.java b/src/main/java/com/adobe/epubcheck/opf/OPFCheckerFactory.java
deleted file mode 100644
index 40ba1e74..00000000
--- a/src/main/java/com/adobe/epubcheck/opf/OPFCheckerFactory.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2011 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.opf;
-
-import com.adobe.epubcheck.util.EPUBVersion;
-
-public class OPFCheckerFactory implements DocumentValidatorFactory, ContentCheckerFactory
-{
-  static private final OPFCheckerFactory instance = new OPFCheckerFactory();
-
-  static public OPFCheckerFactory getInstance()
-  {
-    return instance;
-  }
-
-  public OPFChecker newInstance(ValidationContext context)
-  {
-    if (context.version == EPUBVersion.VERSION_2)
-    {
-      return new OPFChecker(context);
-    }
-    else
-    {
-      return new OPFChecker30(context);
-    }
-  }
-}
diff --git a/src/main/java/com/adobe/epubcheck/opf/OPFData.java b/src/main/java/com/adobe/epubcheck/opf/OPFData.java
index 84ef16c7..e9cc02e2 100644
--- a/src/main/java/com/adobe/epubcheck/opf/OPFData.java
+++ b/src/main/java/com/adobe/epubcheck/opf/OPFData.java
@@ -8,7 +8,6 @@ import com.google.common.collect.Sets;
 
 public final class OPFData
 {
-  public static final String OPF_MIME_TYPE = "application/oebps-package+xml";
   public static final String DC_TYPE_DICT = "dictionary";
   public static final String DC_TYPE_EDUPUB = "edupub";
   public static final String DC_TYPE_INDEX = "index";
diff --git a/src/main/java/com/adobe/epubcheck/opf/PublicationResourceChecker.java b/src/main/java/com/adobe/epubcheck/opf/PublicationResourceChecker.java
new file mode 100755
index 00000000..64485a92
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/opf/PublicationResourceChecker.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2007 Adobe Systems Incorporated
+ *
+ *  Permission is hereby granted, free of charge, to any person obtaining a copy of
+ *  this software and associated documentation files (the "Software"), to deal in
+ *  the Software without restriction, including without limitation the rights to
+ *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ *  the Software, and to permit persons to whom the Software is furnished to do so,
+ *  subject to the following conditions:
+ *
+ *  The above copyright notice and this permission notice shall be included in all
+ *  copies or substantial portions of the Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+package com.adobe.epubcheck.opf;
+
+import org.w3c.epubcheck.core.AbstractChecker;
+
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.messages.MessageId;
+import com.google.common.base.Preconditions;
+
+//FIXME 2021 Romain - document
+public class PublicationResourceChecker extends AbstractChecker
+{
+
+  public PublicationResourceChecker(ValidationContext context)
+  {
+    super(context);
+  }
+  
+
+  @Override
+  public final void check()
+  {
+    boolean cont = !context.ocf.isPresent() || checkPublicationBeforeContent();
+    cont = cont && checkContent();
+    cont = cont && !context.ocf.isPresent() || checkPublicationAfterContent();
+  }
+
+  // by construction we know context.ocf is present
+  protected boolean checkPublicationBeforeContent()
+  {
+    return checkResourceExists(context)
+        && checkResourceCanBeDecrypted(context);
+  }
+
+  protected boolean checkContent()
+  {
+    return true;
+  }
+
+  //by construction we know context.ocf is present
+  protected boolean checkPublicationAfterContent()
+  {
+    return true;
+  }
+
+
+  private static boolean checkResourceExists(ValidationContext context)
+  {
+    Preconditions.checkState(context.ocf.isPresent());
+    if (!context.ocf.get().hasEntry(context.path))
+    {
+      context.report.message(MessageId.RSC_001, EPUBLocation.create(context.ocf.get().getName()),
+          context.path);
+      return false;
+    }
+    else
+    {
+      return true;
+    }
+  }
+
+  private static boolean checkResourceCanBeDecrypted(ValidationContext context)
+  {
+    Preconditions.checkState(context.ocf.isPresent());
+    if (!context.ocf.get().canDecrypt(context.path))
+    {
+      context.report.message(MessageId.RSC_004, EPUBLocation.create(context.ocf.get().getName()),
+          context.path);
+      return false;
+    }
+    else
+    {
+      return true;
+    }
+  }
+}
diff --git a/src/main/java/com/adobe/epubcheck/opf/ValidationContext.java b/src/main/java/com/adobe/epubcheck/opf/ValidationContext.java
index 9d06e5b6..9024d293 100644
--- a/src/main/java/com/adobe/epubcheck/opf/ValidationContext.java
+++ b/src/main/java/com/adobe/epubcheck/opf/ValidationContext.java
@@ -5,6 +5,8 @@ import static com.google.common.base.Preconditions.checkNotNull;
 import java.util.Locale;
 import java.util.Set;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.EPUBProfile;
 import com.adobe.epubcheck.api.FeatureReport;
 import com.adobe.epubcheck.api.LocalizableReport;
@@ -23,8 +25,7 @@ import com.google.common.collect.ImmutableSet;
 
 /**
  * Holds various contextual objects used during validation. This validation
- * context is used by both {@link ContentChecker} and {@link DocumentValidator}
- * instances.
+ * context is notalby used by {@link Checker} instances.
  * 
  */
 public final class ValidationContext
diff --git a/src/main/java/com/adobe/epubcheck/ops/OPSChecker.java b/src/main/java/com/adobe/epubcheck/ops/OPSChecker.java
index 96536594..bde30aa0 100755
--- a/src/main/java/com/adobe/epubcheck/ops/OPSChecker.java
+++ b/src/main/java/com/adobe/epubcheck/ops/OPSChecker.java
@@ -22,19 +22,22 @@
 
 package com.adobe.epubcheck.ops;
 
-import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.*;
-import static com.google.common.base.Predicates.*;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.hasProp;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.hasPubType;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.mimetype;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.profile;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.version;
+import static com.google.common.base.Predicates.and;
+import static com.google.common.base.Predicates.not;
+import static com.google.common.base.Predicates.or;
 
 import java.io.IOException;
 import java.util.List;
 
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.EPUBProfile;
-import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.ocf.OCFPackage;
-import com.adobe.epubcheck.opf.ContentChecker;
-import com.adobe.epubcheck.opf.DocumentValidator;
+import com.adobe.epubcheck.opf.PublicationResourceChecker;
 import com.adobe.epubcheck.opf.OPFData;
 import com.adobe.epubcheck.opf.ValidationContext;
 import com.adobe.epubcheck.util.EPUBVersion;
@@ -46,10 +49,9 @@ import com.adobe.epubcheck.xml.XMLValidator;
 import com.adobe.epubcheck.xml.XMLValidators;
 import com.google.common.base.Predicates;
 
-public class OPSChecker implements ContentChecker, DocumentValidator
+public class OPSChecker extends PublicationResourceChecker
 {
 
-  @SuppressWarnings("unchecked")
   private final static ValidatorMap validatorMap = ValidatorMap.builder()
       .putAll(Predicates.and(mimetype("application/xhtml+xml"), version(EPUBVersion.VERSION_2)),
           XMLValidators.XHTML_20_NVDL, XMLValidators.XHTML_20_SCH, XMLValidators.IDUNIQUE_20_SCH)
@@ -80,49 +82,24 @@ public class OPSChecker implements ContentChecker, DocumentValidator
           XMLValidators.XHTML_DATANAV_SCH)
       .build();
 
-  private final ValidationContext context;
-  private final Report report;
-  private final String path;
 
   public OPSChecker(ValidationContext context)
   {
-    this.context = context;
-    this.path = context.path;
-    this.report = context.report;
+    super(context);
   }
 
-  public void runChecks()
+  @Override
+  protected boolean checkContent()
   {
-    OCFPackage ocf = context.ocf.get();
-    if (!ocf.hasEntry(path))
-    {
-      report.message(MessageId.RSC_001, EPUBLocation.create(ocf.getName()), path);
-    }
-    else if (!ocf.canDecrypt(path))
-    {
-      report.message(MessageId.RSC_004, EPUBLocation.create(ocf.getName()), path);
-    }
-    else
-    {
-      validate();
-    }
-  }
-
-  public boolean validate()
-  {
-    int fatalErrorsSoFar = report.getFatalErrorCount();
-    int errorsSoFar = report.getErrorCount();
-    int warningsSoFar = report.getWarningCount();
     List<XMLValidator> validators = validatorMap.getValidators(context);
     try
     {
       validate(validators);
     } catch (IOException e)
     {
-      report.message(MessageId.PKG_008, EPUBLocation.create(path), path);
+      report.message(MessageId.PKG_008, EPUBLocation.create(context.path), context.path);
     }
-    return fatalErrorsSoFar == report.getFatalErrorCount() && errorsSoFar == report.getErrorCount()
-        && warningsSoFar == report.getWarningCount();
+    return true;
   }
 
   void validate(List<XMLValidator> validators)
diff --git a/src/main/java/com/adobe/epubcheck/ops/OPSCheckerFactory.java b/src/main/java/com/adobe/epubcheck/ops/OPSCheckerFactory.java
deleted file mode 100755
index cddfcf6d..00000000
--- a/src/main/java/com/adobe/epubcheck/ops/OPSCheckerFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2007 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.ops;
-
-import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.DocumentValidatorFactory;
-import com.adobe.epubcheck.opf.ValidationContext;
-
-public class OPSCheckerFactory implements ContentCheckerFactory, DocumentValidatorFactory
-{
-
-  public OPSChecker newInstance(ValidationContext context)
-  {
-    return new OPSChecker(context);
-  }
-
-  static private final OPSCheckerFactory instance = new OPSCheckerFactory();
-
-  static public OPSCheckerFactory getInstance()
-  {
-    return instance;
-  }
-
-}
diff --git a/src/main/java/com/adobe/epubcheck/ops/OPSHandler.java b/src/main/java/com/adobe/epubcheck/ops/OPSHandler.java
index f5c71e5d..d57d11d1 100755
--- a/src/main/java/com/adobe/epubcheck/ops/OPSHandler.java
+++ b/src/main/java/com/adobe/epubcheck/ops/OPSHandler.java
@@ -22,10 +22,8 @@
 
 package com.adobe.epubcheck.ops;
 
-import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
 import java.util.Locale;
 import java.util.Stack;
 
@@ -33,7 +31,7 @@ import javax.xml.XMLConstants;
 
 import com.adobe.epubcheck.api.EPUBLocation;
 import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.css.CSSCheckerFactory;
+import com.adobe.epubcheck.css.CSSChecker;
 import com.adobe.epubcheck.messages.MessageId;
 import com.adobe.epubcheck.opf.OPFChecker;
 import com.adobe.epubcheck.opf.ValidationContext;
@@ -438,8 +436,7 @@ public class OPSHandler implements XMLHandler
         String style = e.getAttribute("style");
         if (style != null && style.length() > 0)
         {
-          CSSCheckerFactory.getInstance()
-              .newInstance(context, style, currentLocation.getLineNumber(), true).runChecks();
+          new CSSChecker(context, style, currentLocation.getLineNumber(), true).check();
         }
       }
     }
@@ -521,8 +518,7 @@ public class OPSHandler implements XMLHandler
         String style = textNode.toString();
         if (style.length() > 0)
         {
-          CSSCheckerFactory.getInstance()
-              .newInstance(context, style, currentLocation.getLineNumber(), false).runChecks();
+          new CSSChecker(context, style, currentLocation.getLineNumber(), false).check();
         }
         textNode = null;
       }
diff --git a/src/main/java/com/adobe/epubcheck/overlay/OverlayChecker.java b/src/main/java/com/adobe/epubcheck/overlay/OverlayChecker.java
index ef4aecaa..a68cfbd5 100644
--- a/src/main/java/com/adobe/epubcheck/overlay/OverlayChecker.java
+++ b/src/main/java/com/adobe/epubcheck/overlay/OverlayChecker.java
@@ -22,54 +22,25 @@
 
 package com.adobe.epubcheck.overlay;
 
-import com.adobe.epubcheck.api.EPUBLocation;
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.ocf.OCFPackage;
-import com.adobe.epubcheck.opf.ContentChecker;
-import com.adobe.epubcheck.opf.DocumentValidator;
+import com.adobe.epubcheck.opf.PublicationResourceChecker;
 import com.adobe.epubcheck.opf.ValidationContext;
 import com.adobe.epubcheck.xml.XMLParser;
 import com.adobe.epubcheck.xml.XMLValidators;
 import com.google.common.base.Preconditions;
 
-public class OverlayChecker implements ContentChecker, DocumentValidator
+public class OverlayChecker extends PublicationResourceChecker
 {
 
-  private final ValidationContext context;
-  private final Report report;
-  private final String path;
 
   public OverlayChecker(ValidationContext context)
   {
+    super(context);
     Preconditions.checkState("application/smil+xml".equals(context.mimeType));
-    this.context = context;
-    this.report = context.report;
-    this.path = context.path;
   }
 
-  public void runChecks()
+  @Override
+  protected boolean checkContent()
   {
-    OCFPackage ocf = context.ocf.get();
-    if (!ocf.hasEntry(path))
-    {
-      report.message(MessageId.RSC_001, EPUBLocation.create(ocf.getName()), path);
-    }
-    else if (!ocf.canDecrypt(path))
-    {
-      report.message(MessageId.RSC_004, EPUBLocation.create(ocf.getName()), path);
-    }
-    else
-    {
-      validate();
-    }
-  }
-
-  public boolean validate()
-  {
-    int fatalErrorsSoFar = report.getFatalErrorCount();
-    int errorsSoFar = report.getErrorCount();
-    int warningsSoFar = report.getWarningCount();
     OverlayHandler overlayHandler;
     XMLParser overlayParser = new XMLParser(context);
     overlayHandler = new OverlayHandler(context, overlayParser);
@@ -77,8 +48,7 @@ public class OverlayChecker implements ContentChecker, DocumentValidator
     overlayParser.addValidator(XMLValidators.MO_30_SCH.get());
     overlayParser.addXMLHandler(overlayHandler);
     overlayParser.process();
-
-    return fatalErrorsSoFar == report.getFatalErrorCount() && errorsSoFar == report.getErrorCount()
-        && warningsSoFar == report.getWarningCount();
+    return true;
   }
+
 }
diff --git a/src/main/java/com/adobe/epubcheck/overlay/OverlayCheckerFactory.java b/src/main/java/com/adobe/epubcheck/overlay/OverlayCheckerFactory.java
deleted file mode 100644
index d1364c05..00000000
--- a/src/main/java/com/adobe/epubcheck/overlay/OverlayCheckerFactory.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2011 Adobe Systems Incorporated
- *
- *  Permission is hereby granted, free of charge, to any person obtaining a copy of
- *  this software and associated documentation files (the "Software"), to deal in
- *  the Software without restriction, including without limitation the rights to
- *  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
- *  the Software, and to permit persons to whom the Software is furnished to do so,
- *  subject to the following conditions:
- *
- *  The above copyright notice and this permission notice shall be included in all
- *  copies or substantial portions of the Software.
- *
- *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
- *  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- *  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
- *  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- *  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-
-package com.adobe.epubcheck.overlay;
-
-import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.DocumentValidatorFactory;
-import com.adobe.epubcheck.opf.ValidationContext;
-
-public class OverlayCheckerFactory implements ContentCheckerFactory, DocumentValidatorFactory
-{
-
-  public OverlayChecker newInstance(ValidationContext context)
-  {
-    return new OverlayChecker(context);
-  }
-
-  static private final OverlayCheckerFactory instance = new OverlayCheckerFactory();
-
-  static public OverlayCheckerFactory getInstance()
-  {
-    return instance;
-  }
-
-}
diff --git a/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java b/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java
index 4648d982..01cdd3bd 100644
--- a/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java
+++ b/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java
@@ -34,19 +34,21 @@ import java.util.Map;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.EPUBProfile;
 import com.adobe.epubcheck.api.EpubCheck;
 import com.adobe.epubcheck.api.EpubCheckFactory;
 import com.adobe.epubcheck.api.LocalizableReport;
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.messages.MessageDictionaryDumper;
-import com.adobe.epubcheck.nav.NavCheckerFactory;
-import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.opf.DocumentValidatorFactory;
-import com.adobe.epubcheck.opf.OPFCheckerFactory;
+import com.adobe.epubcheck.nav.NavChecker;
+import com.adobe.epubcheck.opf.OPFChecker;
+import com.adobe.epubcheck.opf.OPFChecker30;
+import com.adobe.epubcheck.opf.ValidationContext;
 import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
-import com.adobe.epubcheck.ops.OPSCheckerFactory;
-import com.adobe.epubcheck.overlay.OverlayCheckerFactory;
+import com.adobe.epubcheck.ops.OPSChecker;
+import com.adobe.epubcheck.overlay.OverlayChecker;
 import com.adobe.epubcheck.reporting.CheckingReport;
 import com.adobe.epubcheck.util.Archive;
 import com.adobe.epubcheck.util.DefaultReportImpl;
@@ -94,7 +96,6 @@ public class EpubChecker
   int reportingLevel = ReportingLevel.Info;
 
   private static final HashMap<OPSType, String> modeMimeTypeMap;
-  private static final HashMap<OPSType, DocumentValidatorFactory> documentValidatorFactoryMap;
   private static final String EPUBCHECK_CUSTOM_MESSAGE_FILE = "ePubCheckCustomMessageFile";
 
   static
@@ -112,24 +113,6 @@ public class EpubChecker
     modeMimeTypeMap = map;
   }
 
-
-  static
-  {
-    HashMap<OPSType, DocumentValidatorFactory> map = new HashMap<OPSType, DocumentValidatorFactory>();
-    map.put(new OPSType(null, EPUBVersion.VERSION_2), EpubCheckFactory.getInstance());
-    map.put(new OPSType(null, EPUBVersion.VERSION_3), EpubCheckFactory.getInstance());
-    map.put(new OPSType("opf", EPUBVersion.VERSION_2), OPFCheckerFactory.getInstance());
-    map.put(new OPSType("opf", EPUBVersion.VERSION_3), OPFCheckerFactory.getInstance());
-    map.put(new OPSType("xhtml", EPUBVersion.VERSION_2), OPSCheckerFactory.getInstance());
-    map.put(new OPSType("xhtml", EPUBVersion.VERSION_3), OPSCheckerFactory.getInstance());
-    map.put(new OPSType("svg", EPUBVersion.VERSION_2), OPSCheckerFactory.getInstance());
-    map.put(new OPSType("svg", EPUBVersion.VERSION_3), OPSCheckerFactory.getInstance());
-    map.put(new OPSType("mo", EPUBVersion.VERSION_3), OverlayCheckerFactory.getInstance());
-    map.put(new OPSType("nav", EPUBVersion.VERSION_3), NavCheckerFactory.getInstance());
-
-    documentValidatorFactoryMap = map;
-  }
-
   public Locale getLocale() {
     return locale;
   }
@@ -201,9 +184,39 @@ public class EpubChecker
 
     OPSType opsType = new OPSType(mode, version);
 
-    DocumentValidatorFactory factory = documentValidatorFactoryMap.get(opsType);
-
-    if (factory == null)
+    ValidationContext context = new ValidationContextBuilder().path(path)
+        .report(report).resourceProvider(resourceProvider).mimetype(modeMimeTypeMap.get(opsType))
+        .version(version).profile(profile).build();
+    
+    Checker checker = null;
+    if (mode == null) {
+      checker = EpubCheckFactory.getInstance().newInstance(context);
+    } else {
+      switch (mode)
+      {
+      case "opf":
+        if (version == EPUBVersion.VERSION_2) {
+          checker = new OPFChecker(context);
+        } else {
+          checker = new OPFChecker30(context);
+        }
+        break;
+      case "xhtml":
+      case "svg":
+        checker = new OPSChecker(context);
+        break;
+      case "mo":
+        if (version == EPUBVersion.VERSION_3) checker = new OverlayChecker(context);
+        break;
+      case "nav":
+        if (version == EPUBVersion.VERSION_3) checker = new NavChecker(context);
+        break;
+      default:
+        break;
+      }
+    }
+    
+    if (checker == null)
     {
       outWriter.println(messages.get("display_help"));
       System.err.println(String.format(messages.get("mode_version_not_supported"), mode, version));
@@ -212,13 +225,10 @@ public class EpubChecker
           version));
     }
 
-    DocumentValidator check = factory.newInstance(new ValidationContextBuilder().path(path)
-        .report(report).resourceProvider(resourceProvider).mimetype(modeMimeTypeMap.get(opsType))
-        .version(version).profile(profile).build());
 
-    if (check.getClass() == EpubCheck.class)
+    if (checker.getClass() == EpubCheck.class)
     {
-      int validationResult = ((EpubCheck) check).doValidate();
+      int validationResult = ((EpubCheck) checker).doValidate();
       if (validationResult == 0)
       {
         outWriter.println(messages.get("no_errors__or_warnings"));
@@ -234,8 +244,8 @@ public class EpubChecker
     }
     else
     {
-      boolean validationResult = check.validate();
-      if (validationResult)
+      checker.check();
+      if (report.getWarningCount() == 0 && report.getFatalErrorCount() == 0 && report.getErrorCount() == 0)
       {
         outWriter.println(messages.get("no_errors__or_warnings"));
         return 0;
diff --git a/src/main/java/com/adobe/epubcheck/util/OPSType.java b/src/main/java/com/adobe/epubcheck/util/OPSType.java
index bb80d9c8..ce86bf02 100644
--- a/src/main/java/com/adobe/epubcheck/util/OPSType.java
+++ b/src/main/java/com/adobe/epubcheck/util/OPSType.java
@@ -24,8 +24,8 @@ package com.adobe.epubcheck.util;
 
 public class OPSType
 {
-  private final EPUBVersion version;
-  private final String mimeType;
+  public final EPUBVersion version;
+  public final String mimeType;
 
   public OPSType(String mimeType, EPUBVersion version)
   {
diff --git a/src/main/java/org/w3c/epubcheck/constants/MIMEType.java b/src/main/java/org/w3c/epubcheck/constants/MIMEType.java
new file mode 100644
index 00000000..eeadc9ad
--- /dev/null
+++ b/src/main/java/org/w3c/epubcheck/constants/MIMEType.java
@@ -0,0 +1,55 @@
+package org.w3c.epubcheck.constants;
+
+import java.util.Collections;
+import java.util.Locale;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import com.google.common.base.Optional;
+
+//FIXME 2021 Romain - document
+public enum MIMEType
+{
+  CSS("text/css"),
+  DTBOOK("application/x-dtbook+xml"),
+  EPUB("application/epub+zip"),
+  HTML("text/html"),
+  IMAGE_JPEG("image/jpeg"),
+  IMAGE_GIF("image/gif"),
+  IMAGE_PNG("image/png"),
+  OEBPS("text/x-oeb1-document"),
+  PACKAGE_DOC("application/oebps-package+xml"),
+  SEARCH_KEY_MAP("application/vnd.epub.search-key-map+xml"),
+  SMIL("application/smil+xml"),
+  SVG("image/svg+xml"),
+  XHTML("application/xhtml+xml");
+
+  private static final Map<String, MIMEType> ENUM_MAP;
+
+  private final String definition;
+
+  private MIMEType(final String definition)
+  {
+    this.definition = definition;
+  }
+
+  public String toString()
+  {
+    return definition;
+  }
+
+  static
+  {
+    Map<String, MIMEType> map = new ConcurrentHashMap<String, MIMEType>();
+    for (MIMEType value : MIMEType.values())
+    {
+      map.put(value.toString(), value);
+    }
+    ENUM_MAP = Collections.unmodifiableMap(map);
+  }
+
+  public static Optional<MIMEType> get(String name)
+  {
+    return Optional.fromNullable(ENUM_MAP.get(name.toLowerCase(Locale.ENGLISH)));
+  }
+}
diff --git a/src/main/java/org/w3c/epubcheck/core/AbstractChecker.java b/src/main/java/org/w3c/epubcheck/core/AbstractChecker.java
new file mode 100644
index 00000000..67225390
--- /dev/null
+++ b/src/main/java/org/w3c/epubcheck/core/AbstractChecker.java
@@ -0,0 +1,19 @@
+package org.w3c.epubcheck.core;
+
+import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.opf.ValidationContext;
+import com.google.common.base.Preconditions;
+
+//FIXME 2021 Romain - document
+public abstract class AbstractChecker implements Checker
+{
+
+  protected final ValidationContext context;
+  protected final Report report;
+
+  public AbstractChecker(ValidationContext context)
+  {
+    this.context = Preconditions.checkNotNull(context);
+    this.report = context.report;
+  }
+}
diff --git a/src/main/java/org/w3c/epubcheck/core/Checker.java b/src/main/java/org/w3c/epubcheck/core/Checker.java
new file mode 100644
index 00000000..5801ee6d
--- /dev/null
+++ b/src/main/java/org/w3c/epubcheck/core/Checker.java
@@ -0,0 +1,6 @@
+package org.w3c.epubcheck.core;
+
+//FIXME 2021 Romain - document
+public interface Checker {
+	public void check();
+}
diff --git a/src/main/java/org/w3c/epubcheck/core/CheckerFactory.java b/src/main/java/org/w3c/epubcheck/core/CheckerFactory.java
new file mode 100644
index 00000000..206d4358
--- /dev/null
+++ b/src/main/java/org/w3c/epubcheck/core/CheckerFactory.java
@@ -0,0 +1,69 @@
+package org.w3c.epubcheck.core;
+
+import org.w3c.epubcheck.constants.MIMEType;
+
+import com.adobe.epubcheck.bitmap.BitmapChecker;
+import com.adobe.epubcheck.css.CSSChecker;
+import com.adobe.epubcheck.dict.SearchKeyMapChecker;
+import com.adobe.epubcheck.dtbook.DTBookChecker;
+import com.adobe.epubcheck.opf.PublicationResourceChecker;
+import com.adobe.epubcheck.opf.OPFChecker;
+import com.adobe.epubcheck.opf.OPFChecker30;
+import com.adobe.epubcheck.opf.ValidationContext;
+import com.adobe.epubcheck.ops.OPSChecker;
+import com.adobe.epubcheck.overlay.OverlayChecker;
+import com.adobe.epubcheck.util.EPUBVersion;
+import com.google.common.base.Optional;
+
+// FIXME 2021 Romain - document
+public final class CheckerFactory
+{
+  public enum CheckerTypes
+  {
+
+  }
+
+  public static Checker newChecker(ValidationContext context)
+  {
+    Optional<MIMEType> mimeType = MIMEType.get(context.mimeType);
+    if (mimeType.isPresent())
+    {
+      switch (mimeType.get())
+      {
+      case CSS:
+        return new CSSChecker(context);
+      case DTBOOK:
+        return new DTBookChecker(context);
+      case EPUB:
+        // FIXME 2021 Romain - ValidationContext-based EPUB checker will come later
+        break;
+      case HTML:
+        if (context.version == EPUBVersion.VERSION_2) return new OPSChecker(context);
+        break;
+      case IMAGE_GIF:
+      case IMAGE_JPEG:
+      case IMAGE_PNG:
+        return new BitmapChecker(context);
+      case OEBPS:
+        if (context.version == EPUBVersion.VERSION_2) return new OPSChecker(context);
+        break;
+      case PACKAGE_DOC:
+        return (context.version == EPUBVersion.VERSION_2) ? new OPFChecker(context)
+            : new OPFChecker30(context);
+      case SEARCH_KEY_MAP:
+        if (context.version == EPUBVersion.VERSION_3) return new SearchKeyMapChecker(context);
+        break;
+      case SVG:
+        return new OPSChecker(context);
+      case SMIL:
+        if (context.version == EPUBVersion.VERSION_3) return new OverlayChecker(context);
+        break;
+      case XHTML:
+        return new OPSChecker(context);
+      default:
+        break;
+      }
+    }
+    return new PublicationResourceChecker(context);
+  }
+}


Test patch:
diff --git a/src/test/java/com/adobe/epubcheck/stress/StressTest.java b/src/test/java/com/adobe/epubcheck/stress/StressTest.java
index 76a7b0ef..a833b78a 100644
--- a/src/test/java/com/adobe/epubcheck/stress/StressTest.java
+++ b/src/test/java/com/adobe/epubcheck/stress/StressTest.java
@@ -91,7 +91,7 @@ public class StressTest
     epub.createArchive();
     ValidationReport report = new ValidationReport(TEMP_DIR.getName());
     EpubCheck epubCheck = new EpubCheck(epub.getEpubFile(), report);
-    epubCheck.validate();
+    epubCheck.check();
     assertTrue(report.getErrorCount() < 1);
     assertTrue(report.getWarningCount() < 1);
     epub.deleteEpubFile();
diff --git a/src/test/java/org/w3c/epubcheck/test/ExecutionSteps.java b/src/test/java/org/w3c/epubcheck/test/ExecutionSteps.java
index 81729d7c..b780e075 100644
--- a/src/test/java/org/w3c/epubcheck/test/ExecutionSteps.java
+++ b/src/test/java/org/w3c/epubcheck/test/ExecutionSteps.java
@@ -9,13 +9,16 @@ import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Locale;
 
+import org.w3c.epubcheck.core.Checker;
+
 import com.adobe.epubcheck.api.EPUBProfile;
 import com.adobe.epubcheck.api.EpubCheck;
 import com.adobe.epubcheck.api.Report;
 import com.adobe.epubcheck.messages.Severity;
 import com.adobe.epubcheck.nav.NavChecker;
-import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.opf.OPFCheckerFactory;
+import com.adobe.epubcheck.opf.OPFChecker;
+import com.adobe.epubcheck.opf.OPFChecker30;
+import com.adobe.epubcheck.opf.ValidationContext;
 import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
 import com.adobe.epubcheck.ops.OPSChecker;
 import com.adobe.epubcheck.overlay.OverlayChecker;
@@ -123,15 +126,15 @@ public class ExecutionSteps
     {
       Locale.setDefault(defaultLocale);
       File testFile = getEPUBFile(basepath + path);
-      DocumentValidator checker = getChecker(mode, testFile, version, profile, report);
-      checker.validate();
+      Checker checker = getChecker(mode, testFile, version, profile, report);
+      checker.check();
     } finally
     {
       Locale.setDefault(oldDefaultLocale);
     }
   }
 
-  private DocumentValidator getChecker(CheckerMode mode, File file, EPUBVersion version,
+  private Checker getChecker(CheckerMode mode, File file, EPUBVersion version,
       EPUBProfile profile, Report report)
   {
     switch (mode)
@@ -147,11 +150,11 @@ public class ExecutionSteps
               .resourceProvider(new FileResourceProvider(file.getPath())).report(report)
               .version(EPUBVersion.VERSION_3).profile(profile).build());
     case PACKAGE_DOC:
-      return OPFCheckerFactory.getInstance()
-          .newInstance(new ValidationContextBuilder().path(file.getPath())
-              .mimetype("application/oebps-package+xml")
-              .resourceProvider(new FileResourceProvider(file.getPath())).report(report)
-              .version(version).profile(profile).build());
+      ValidationContext context = new ValidationContextBuilder().path(file.getPath())
+          .mimetype("application/oebps-package+xml")
+          .resourceProvider(new FileResourceProvider(file.getPath())).report(report)
+          .version(version).profile(profile).build();
+      return (context.version == EPUBVersion.VERSION_2)?new OPFChecker(context):new OPFChecker30(context);
     case SVG_CONTENT_DOC:
       return new OPSChecker(new ValidationContextBuilder().path(file.getPath())
           .mimetype("image/svg+xml").resourceProvider(new FileResourceProvider(file.getPath()))