diff --git a/release-notes/VERSION b/release-notes/VERSION
index 4444103..a662636 100644
--- a/release-notes/VERSION
+++ b/release-notes/VERSION
@@ -34,6 +34,8 @@
   'this node' (unless already returning something)
 * [JACKSON-770]: Simplify method naming for JsonNode, drop unnecessary 'get' prefix
   from methods like 'getTextValue()' (becomes 'textValue()')
+* [JACKSON-777]: Rename 'SerializationConfig.Feature' as 'SerializationFeature',
+  'DeserializationConfig.Feature' as 'DeserializationFeature'.
 
 New features:
 
diff --git a/src/main/java/com/fasterxml/jackson/databind/AbstractTypeResolver.java b/src/main/java/com/fasterxml/jackson/databind/AbstractTypeResolver.java
index 9035161..0c0bbf7 100644
--- a/src/main/java/com/fasterxml/jackson/databind/AbstractTypeResolver.java
+++ b/src/main/java/com/fasterxml/jackson/databind/AbstractTypeResolver.java
@@ -1,5 +1,7 @@
 package com.fasterxml.jackson.databind;
 
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
+
 /**
  * Defines interface for resolvers that can resolve abstract types into concrete
  * ones; either by using static mappings, or possibly by materializing
diff --git a/src/main/java/com/fasterxml/jackson/databind/BeanProperty.java b/src/main/java/com/fasterxml/jackson/databind/BeanProperty.java
index bcdd6f0..b0f3f72 100644
--- a/src/main/java/com/fasterxml/jackson/databind/BeanProperty.java
+++ b/src/main/java/com/fasterxml/jackson/databind/BeanProperty.java
@@ -6,22 +6,24 @@
 import com.fasterxml.jackson.databind.util.Annotations;
 import com.fasterxml.jackson.databind.util.Named;
 
-
 /**
  * Bean properties are logical entities that represent data
- * Java objects ("beans", although more accurately POJOs)
- * contain; and that are accessed using some combination
- * of methods (getter, setter), field and constructor
- * parameter.
+ * that Java objects (POJOs (Plain Old Java Objects), sometimes also called "beans")
+ * contain; and that are accessed using accessors (methods like getters
+ * and setters, fields, contstructor parametrers).
  * Instances allow access to annotations directly associated
  * to property (via field or method), as well as contextual
  * annotations (annotations for class that contains properties).
  *<p>
- * Instances are passed during construction of serializers and
- * deserializers, and references can be stored by serializers
- * and deserializers for futher use; mostly to retain access
- * to annotations when dynamically locating handlers for
- * sub-properties or dynamic types.
+ * Instances are not typically passed when constructing serializers
+ * and deserializers, but rather only passed when context
+ * is known when
+ * {@link com.fasterxml.jackson.databind.ser.ContextualSerializer} and
+ * {@link com.fasterxml.jackson.databind.deser.ContextualDeserializer}
+ * resolution occurs (<code>createContextual(...)</code> method is called).
+ * References may (need to) be retained by serializers and deserializers,
+ * especially when further resolving dependant handlers like value
+ * serializers/deserializers or structured types.
  */
 public interface BeanProperty extends Named
 {
@@ -58,11 +60,14 @@
     
     /*
     /**********************************************************
-    /* Simple stand-alone implementation, useful as a placeholder
-    /* or base class.
+    /* Helper classes
     /**********************************************************
      */
 
+    /**
+     * Simple stand-alone implementation, useful as a placeholder
+     * or base class for more complex implementations.
+     */
     public static class Std implements BeanProperty
     {
         protected final String _name;
diff --git a/src/main/java/com/fasterxml/jackson/databind/BeanPropertyDefinition.java b/src/main/java/com/fasterxml/jackson/databind/BeanPropertyDefinition.java
index 1ed2828..c2e8946 100644
--- a/src/main/java/com/fasterxml/jackson/databind/BeanPropertyDefinition.java
+++ b/src/main/java/com/fasterxml/jackson/databind/BeanPropertyDefinition.java
@@ -12,7 +12,8 @@
  * serialization and deserialization purposes.
  * These instances are created before actual {@link BeanProperty}
  * instances are created, i.e. they are used earlier in the process
- * flow.
+ * flow, and are typically use to construct actual
+ * {@link BeanProperty} instances.
  */
 public abstract class BeanPropertyDefinition
     implements Named
diff --git a/src/main/java/com/fasterxml/jackson/databind/DeserializationConfig.java b/src/main/java/com/fasterxml/jackson/databind/DeserializationConfig.java
deleted file mode 100644
index d3130ea..0000000
--- a/src/main/java/com/fasterxml/jackson/databind/DeserializationConfig.java
+++ /dev/null
@@ -1,707 +0,0 @@
-package com.fasterxml.jackson.databind;
-
-import java.text.DateFormat;
-import java.util.*;
-
-import com.fasterxml.jackson.annotation.*;
-import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
-import com.fasterxml.jackson.core.*;
-import com.fasterxml.jackson.databind.cfg.BaseSettings;
-import com.fasterxml.jackson.databind.cfg.ConfigFeature;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
-import com.fasterxml.jackson.databind.cfg.MapperConfigBase;
-import com.fasterxml.jackson.databind.deser.DeserializationProblemHandler;
-import com.fasterxml.jackson.databind.introspect.ClassIntrospector;
-import com.fasterxml.jackson.databind.introspect.NopAnnotationIntrospector;
-import com.fasterxml.jackson.databind.introspect.VisibilityChecker;
-import com.fasterxml.jackson.databind.jsontype.SubtypeResolver;
-import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder;
-import com.fasterxml.jackson.databind.node.JsonNodeFactory;
-import com.fasterxml.jackson.databind.type.ClassKey;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-import com.fasterxml.jackson.databind.util.LinkedNode;
-
-/**
- * Object that contains baseline configuration for deserialization
- * process. An instance is owned by {@link ObjectMapper}, which
- * passes an immutable instance to be used for deserialization process.
- *<p>
- * Note that instances are considered immutable and as such no copies
- * should need to be created (there are some implementation details
- * with respect to mix-in annotations; where this is guaranteed as
- * long as caller follow "copy-then-use" pattern)
- */
-public final class DeserializationConfig
-    extends MapperConfigBase<DeserializationConfig.Feature, DeserializationConfig>
-{
-    /**
-     * Enumeration that defines simple on/off features that affect
-     * the way Java objects are deserialized from JSON
-     *<p>
-     * Note that features can be set both through
-     * {@link ObjectMapper} (as sort of defaults) and through
-     * {@link ObjectReader}.
-     * In first case these defaults must follow "config-then-use" patterns
-     * (i.e. defined once, not changed afterwards); all per-call
-     * changes must be done using {@link ObjectReader}.
-     */
-    public enum Feature implements ConfigFeature
-    {
-        /*
-        /******************************************************
-        /* Type conversion features
-        /******************************************************
-         */
-
-        /**
-         * Feature that determines whether JSON floating point numbers
-         * are to be deserialized into {@link java.math.BigDecimal}s
-         * if only generic type description (either {@link Object} or
-         * {@link Number}, or within untyped {@link java.util.Map}
-         * or {@link java.util.Collection} context) is available.
-         * If enabled such values will be deserialized as {@link java.math.BigDecimal}s;
-         * if disabled, will be deserialized as {@link Double}s.
-         * <p>
-         * Feature is disabled by default, meaning that "untyped" floating
-         * point numbers will by default be deserialized as {@link Double}s
-         * (choice is for performance reason -- BigDecimals are slower than
-         * Doubles).
-         */
-        USE_BIG_DECIMAL_FOR_FLOATS(false),
-
-        /**
-         * Feature that determines whether JSON integral (non-floating-point)
-         * numbers are to be deserialized into {@link java.math.BigInteger}s
-         * if only generic type description (either {@link Object} or
-         * {@link Number}, or within untyped {@link java.util.Map}
-         * or {@link java.util.Collection} context) is available.
-         * If enabled such values will be deserialized as
-         * {@link java.math.BigInteger}s;
-         * if disabled, will be deserialized as "smallest" available type,
-         * which is either {@link Integer}, {@link Long} or
-         * {@link java.math.BigInteger}, depending on number of digits.
-         * <p>
-         * Feature is disabled by default, meaning that "untyped" floating
-         * point numbers will by default be deserialized using whatever
-         * is the most compact integral type, to optimize efficiency.
-         */
-        USE_BIG_INTEGER_FOR_INTS(false),
-
-        // [JACKSON-652]
-        /**
-         * Feature that determines whether JSON Array is mapped to
-         * <code>Object[]</code> or <code>List&lt;Object></code> when binding
-         * "untyped" objects (ones with nominal type of <code>java.lang.Object</code>).
-         * If true, binds as <code>Object[]</code>; if false, as <code>List&lt;Object></code>.
-         *<p>
-         * Feature is disabled by default, meaning that JSON arrays are bound as
-         * {@link java.util.List}s.
-         */
-        USE_JAVA_ARRAY_FOR_JSON_ARRAY(false),
-        
-        /**
-         * Feature that determines standard deserialization mechanism used for
-         * Enum values: if enabled, Enums are assumed to have been serialized  using
-         * return value of <code>Enum.toString()</code>;
-         * if disabled, return value of <code>Enum.name()</code> is assumed to have been used.
-         *<p>
-         * Note: this feature should usually have same value
-         * as {@link SerializationConfig.Feature#WRITE_ENUMS_USING_TO_STRING}.
-         *<p>
-         * Feature is disabled by default.
-         */
-        READ_ENUMS_USING_TO_STRING(false),
-        
-        /*
-        /******************************************************
-         *  Error handling features
-        /******************************************************
-         */
-
-        /**
-         * Feature that determines whether encountering of unknown
-         * properties (ones that do not map to a property, and there is
-         * no "any setter" or handler that can handle it)
-         * should result in a failure (by throwing a
-         * {@link JsonMappingException}) or not.
-         * This setting only takes effect after all other handling
-         * methods for unknown properties have been tried, and
-         * property remains unhandled.
-         *<p>
-         * Feature is enabled by default (meaning that a
-         * {@link JsonMappingException} will be thrown if an unknown property
-         * is encountered).
-         */
-        FAIL_ON_UNKNOWN_PROPERTIES(true),
-
-        /**
-         * Feature that determines whether encountering of JSON null
-         * is an error when deserializing into Java primitive types
-         * (like 'int' or 'double'). If it is, a JsonProcessingException
-         * is thrown to indicate this; if not, default value is used
-         * (0 for 'int', 0.0 for double, same defaulting as what JVM uses).
-         *<p>
-         * Feature is disabled by default.
-         */
-        FAIL_ON_NULL_FOR_PRIMITIVES(false),
-
-        /**
-         * Feature that determines whether JSON integer numbers are valid
-         * values to be used for deserializing Java enum values.
-         * If set to 'false' numbers are acceptable and are used to map to
-         * ordinal() of matching enumeration value; if 'true', numbers are
-         * not allowed and a {@link JsonMappingException} will be thrown.
-         * Latter behavior makes sense if there is concern that accidental
-         * mapping from integer values to enums might happen (and when enums
-         * are always serialized as JSON Strings)
-         *<p>
-         * Feature is disabled by default.
-         */
-        FAIL_ON_NUMBERS_FOR_ENUMS(false),
-
-        /**
-         * Feature that determines whether Jackson code should catch
-         * and wrap {@link Exception}s (but never {@link Error}s!)
-         * to add additional information about
-         * location (within input) of problem or not. If enabled,
-         * most exceptions will be caught and re-thrown (exception
-         * specifically being that {@link java.io.IOException}s may be passed
-         * as is, since they are declared as throwable); this can be
-         * convenient both in that all exceptions will be checked and
-         * declared, and so there is more contextual information.
-         * However, sometimes calling application may just want "raw"
-         * unchecked exceptions passed as is.
-         *<p>
-         * Feature is enabled by default.
-         */
-        WRAP_EXCEPTIONS(true),
-        
-        /*
-        /******************************************************
-         *  Structural conversion features
-        /******************************************************
-         */
-
-        /**
-         * Feature that determines whether it is acceptable to coerce non-array
-         * (in JSON) values to work with Java collection (arrays, java.util.Collection)
-         * types. If enabled, collection deserializers will try to handle non-array
-         * values as if they had "implicit" surrounding JSON array.
-         * This feature is meant to be used for compatibility/interoperability reasons,
-         * to work with packages (such as XML-to-JSON converters) that leave out JSON
-         * array in cases where there is just a single element in array.
-         *<p>
-         * Feature is disabled by default.
-         */
-        ACCEPT_SINGLE_VALUE_AS_ARRAY(false),
-        
-        /**
-         * Feature to allow "unwrapping" root-level JSON value, to match setting of
-         * {@link SerializationConfig.Feature#WRAP_ROOT_VALUE} used for serialization.
-         * Will verify that the root JSON value is a JSON Object, and that it has
-         * a single property with expected root name. If not, a
-         * {@link JsonMappingException} is thrown; otherwise value of the wrapped property
-         * will be deserialized as if it was the root value.
-         *<p>
-         * Feature is disabled by default.
-         */
-        UNWRAP_ROOT_VALUE(false),
-
-        /*
-        /******************************************************
-        /* Value conversion features
-        /******************************************************
-         */
-        
-        /**
-         * Feature that can be enabled to allow JSON empty String
-         * value ("") to be bound to POJOs as null.
-         * If disabled, standard POJOs can only be bound from JSON null or
-         * JSON Object (standard meaning that no custom deserializers or
-         * constructors are defined; both of which can add support for other
-         * kinds of JSON values); if enable, empty JSON String can be taken
-         * to be equivalent of JSON null.
-         *<p>
-         * Feature is enabled by default.
-         */
-        ACCEPT_EMPTY_STRING_AS_NULL_OBJECT(false)
-        
-        ;
-
-        private final boolean _defaultState;
-        
-        private Feature(boolean defaultState) {
-            _defaultState = defaultState;
-        }
-
-        @Override
-        public boolean enabledByDefault() { return _defaultState; }
-    
-        @Override
-        public int getMask() { return (1 << ordinal()); }
-    }
-
-    /*
-    /**********************************************************
-    /* Configuration settings for deserialization
-    /**********************************************************
-     */
-
-    /**
-     * Set of features enabled; actual type (kind of features)
-     * depends on sub-classes.
-     */
-    protected final int _deserFeatures;
-
-    /**
-     * Linked list that contains all registered problem handlers.
-     * Implementation as front-added linked list allows for sharing
-     * of the list (tail) without copying the list.
-     */
-    protected final LinkedNode<DeserializationProblemHandler> _problemHandlers;
-    
-    /**
-     * Factory used for constructing {@link com.fasterxml.jackson.core.JsonNode} instances.
-     */
-    protected final JsonNodeFactory _nodeFactory;
-    
-    /*
-    /**********************************************************
-    /* Life-cycle, constructors
-    /**********************************************************
-     */
-
-    /**
-     * Constructor used by ObjectMapper to create default configuration object instance.
-     */
-    public DeserializationConfig(BaseSettings base,
-            SubtypeResolver str, Map<ClassKey,Class<?>> mixins)
-    {
-        super(base, str, mixins);
-        _deserFeatures = collectFeatureDefaults(DeserializationConfig.Feature.class);
-        _nodeFactory = JsonNodeFactory.instance;
-        _problemHandlers = null;
-    }
-
-    /**
-     * Copy constructor used to create a non-shared instance with given mix-in
-     * annotation definitions and subtype resolver.
-     */
-    private DeserializationConfig(DeserializationConfig src, SubtypeResolver str)
-    {
-        super(src, str);
-        _deserFeatures = src._deserFeatures;
-        _nodeFactory = src._nodeFactory;
-        _problemHandlers = src._problemHandlers;
-    }
-
-    private DeserializationConfig(DeserializationConfig src,
-            int mapperFeatures, int deserFeatures)
-    {
-        super(src, mapperFeatures);
-        _deserFeatures = deserFeatures;
-        _nodeFactory = src._nodeFactory;
-        _problemHandlers = src._problemHandlers;
-    }
-    
-    private DeserializationConfig(DeserializationConfig src, BaseSettings base)
-    {
-        super(src, base);
-        _deserFeatures = src._deserFeatures;
-        _nodeFactory = src._nodeFactory;
-        _problemHandlers = src._problemHandlers;
-    }
-    
-    private DeserializationConfig(DeserializationConfig src, JsonNodeFactory f)
-    {
-        super(src);
-        _deserFeatures = src._deserFeatures;
-        _problemHandlers = src._problemHandlers;
-        _nodeFactory = f;
-    }
-
-    private DeserializationConfig(DeserializationConfig src,
-            LinkedNode<DeserializationProblemHandler> problemHandlers)
-    {
-        super(src);
-        _deserFeatures = src._deserFeatures;
-        _problemHandlers = problemHandlers;
-        _nodeFactory = src._nodeFactory;
-    }
-
-    private DeserializationConfig(DeserializationConfig src, String rootName)
-    {
-        super(src, rootName);
-        _deserFeatures = src._deserFeatures;
-        _problemHandlers = src._problemHandlers;
-        _nodeFactory = src._nodeFactory;
-    }
-
-    private DeserializationConfig(DeserializationConfig src, Class<?> view)
-    {
-        super(src, view);
-        _deserFeatures = src._deserFeatures;
-        _problemHandlers = src._problemHandlers;
-        _nodeFactory = src._nodeFactory;
-    }
-    
-    /*
-    /**********************************************************
-    /* Life-cycle, factory methods from MapperConfig
-    /**********************************************************
-     */
-
-    @Override
-    public DeserializationConfig with(MapperConfig.Feature... features)
-    {
-        int newMapperFlags = _mapperFeatures;
-        for (MapperConfig.Feature f : features) {
-            newMapperFlags |= f.getMask();
-        }
-        return (newMapperFlags == _mapperFeatures) ? this :
-            new DeserializationConfig(this, newMapperFlags, _deserFeatures);
-    }
-
-    @Override
-    public DeserializationConfig without(MapperConfig.Feature... features)
-    {
-        int newMapperFlags = _mapperFeatures;
-        for (MapperConfig.Feature f : features) {
-             newMapperFlags &= ~f.getMask();
-        }
-        return (newMapperFlags == _mapperFeatures) ? this :
-            new DeserializationConfig(this, newMapperFlags, _deserFeatures);
-    }
-    
-    @Override
-    public DeserializationConfig withClassIntrospector(ClassIntrospector ci) {
-        return _withBase(_base.withClassIntrospector(ci));
-    }
-
-    @Override
-    public DeserializationConfig withAnnotationIntrospector(AnnotationIntrospector ai) {
-        return _withBase(_base.withAnnotationIntrospector(ai));
-    }
-
-    @Override
-    public DeserializationConfig withVisibilityChecker(VisibilityChecker<?> vc) {
-        return _withBase(_base.withVisibilityChecker(vc));
-    }
-
-    @Override
-    public DeserializationConfig withVisibility(PropertyAccessor forMethod, JsonAutoDetect.Visibility visibility) {
-        return _withBase( _base.withVisibility(forMethod, visibility));
-    }
-    
-    @Override
-    public DeserializationConfig withTypeResolverBuilder(TypeResolverBuilder<?> trb) {
-        return _withBase(_base.withTypeResolverBuilder(trb));
-    }
-
-    @Override
-    public DeserializationConfig withSubtypeResolver(SubtypeResolver str) {
-        return (_subtypeResolver == str) ? this : new DeserializationConfig(this, str);
-    }
-    
-    @Override
-    public DeserializationConfig withPropertyNamingStrategy(PropertyNamingStrategy pns) {
-        return _withBase(_base.withPropertyNamingStrategy(pns));
-    }
-
-    @Override
-    public DeserializationConfig withRootName(String rootName) {
-        if (rootName == null) {
-            if (_rootName == null) {
-                return this;
-            }
-        } else if (rootName.equals(_rootName)) {
-            return this;
-        }
-        return new DeserializationConfig(this, rootName);
-    }
-    
-    @Override
-    public DeserializationConfig withTypeFactory(TypeFactory tf) {
-        return _withBase( _base.withTypeFactory(tf));
-    }
-
-    @Override
-    public DeserializationConfig withDateFormat(DateFormat df) {
-        return _withBase(_base.withDateFormat(df));
-    }
-    
-    @Override
-    public DeserializationConfig withHandlerInstantiator(HandlerInstantiator hi) {
-        return _withBase(_base.withHandlerInstantiator(hi));
-    }
-
-    @Override
-    public DeserializationConfig withInsertedAnnotationIntrospector(AnnotationIntrospector ai) {
-        return _withBase(_base.withInsertedAnnotationIntrospector(ai));
-    }
-
-    @Override
-    public DeserializationConfig withAppendedAnnotationIntrospector(AnnotationIntrospector ai) {
-        return _withBase(_base.withAppendedAnnotationIntrospector(ai));
-    }
-
-    @Override
-    public DeserializationConfig withView(Class<?> view) {
-        return (_view == view) ? this : new DeserializationConfig(this, view);
-    }
-    
-    private final DeserializationConfig _withBase(BaseSettings newBase) {
-        return (_base == newBase) ? this : new DeserializationConfig(this, newBase);
-    }
-    
-    /*
-    /**********************************************************
-    /* Life-cycle, deserialization-specific factory methods
-    /**********************************************************
-     */
-
-    /**
-     * Fluent factory method that will construct a new instance with
-     * specified {@link JsonNodeFactory}
-     */
-    public DeserializationConfig withNodeFactory(JsonNodeFactory f) {
-        if (_nodeFactory == f) {
-            return this;
-        }
-        return new DeserializationConfig(this, f);
-    }
-
-    /**
-     * Method that can be used to add a handler that can (try to)
-     * resolve non-fatal deserialization problems.
-     */
-    public DeserializationConfig withHandler(DeserializationProblemHandler h)
-    {
-        // Sanity check: let's prevent adding same handler multiple times
-        if (LinkedNode.contains(_problemHandlers, h)) {
-            return this;
-        }
-        return new DeserializationConfig(this,
-                new LinkedNode<DeserializationProblemHandler>(h, _problemHandlers));
-    }
-
-    /**
-     * Method for removing all configured problem handlers; usually done to replace
-     * existing handler(s) with different one(s)
-     */
-    public DeserializationConfig withNoProblemHandlers() {
-        if (_problemHandlers == null) {
-            return this;
-        }
-        return new DeserializationConfig(this,
-                (LinkedNode<DeserializationProblemHandler>) null);
-    }
-
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified features enabled.
-     */
-    public DeserializationConfig with(DeserializationConfig.Feature feature)
-    {
-        int newDeserFeatures = (_deserFeatures | feature.getMask());
-        return (newDeserFeatures == _deserFeatures) ? this :
-            new DeserializationConfig(this, _mapperFeatures, newDeserFeatures);
-    }
-
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified features enabled.
-     */
-    public DeserializationConfig with(DeserializationConfig.Feature first,
-            DeserializationConfig.Feature... features)
-    {
-        int newDeserFeatures = _deserFeatures | first.getMask();
-        for (Feature f : features) {
-            newDeserFeatures |= f.getMask();
-        }
-        return (newDeserFeatures == _deserFeatures) ? this :
-            new DeserializationConfig(this, _mapperFeatures, newDeserFeatures);
-    }
-
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified features enabled.
-     */
-    public DeserializationConfig withFeatures(DeserializationConfig.Feature... features)
-    {
-        int newDeserFeatures = _deserFeatures;
-        for (Feature f : features) {
-            newDeserFeatures |= f.getMask();
-        }
-        return (newDeserFeatures == _deserFeatures) ? this :
-            new DeserializationConfig(this, _mapperFeatures, newDeserFeatures);
-    }
-    
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified feature disabled.
-     */
-    public DeserializationConfig without(DeserializationConfig.Feature feature)
-    {
-        int newDeserFeatures = _deserFeatures & ~feature.getMask();
-        return (newDeserFeatures == _deserFeatures) ? this :
-            new DeserializationConfig(this, _mapperFeatures, newDeserFeatures);
-    }
-
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified features disabled.
-     */
-    public DeserializationConfig without(DeserializationConfig.Feature first,
-            DeserializationConfig.Feature... features)
-    {
-        int newDeserFeatures = _deserFeatures & ~first.getMask();
-        for (Feature f : features) {
-            newDeserFeatures &= ~f.getMask();
-        }
-        return (newDeserFeatures == _deserFeatures) ? this :
-            new DeserializationConfig(this, _mapperFeatures, newDeserFeatures);
-    }
-
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified features disabled.
-     */
-    public DeserializationConfig withoutFeatures(DeserializationConfig.Feature... features)
-    {
-        int newDeserFeatures = _deserFeatures;
-        for (Feature f : features) {
-            newDeserFeatures &= ~f.getMask();
-        }
-        return (newDeserFeatures == _deserFeatures) ? this :
-            new DeserializationConfig(this, _mapperFeatures, newDeserFeatures);
-    }
-    
-    /*
-    /**********************************************************
-    /* MapperConfig implementation
-    /**********************************************************
-     */
-    
-    /**
-     * Method for getting {@link AnnotationIntrospector} configured
-     * to introspect annotation values used for configuration.
-     */
-    @Override
-    public AnnotationIntrospector getAnnotationIntrospector()
-    {
-        /* 29-Jul-2009, tatu: it's now possible to disable use of
-         *   annotations; can be done using "no-op" introspector
-         */
-        if (isEnabled(MapperConfig.Feature.USE_ANNOTATIONS)) {
-            return super.getAnnotationIntrospector();
-        }
-        return NopAnnotationIntrospector.instance;
-    }
-
-    @Override
-    public boolean useRootWrapping()
-    {
-        if (_rootName != null) { // empty String disables wrapping; non-empty enables
-            return (_rootName.length() > 0);
-        }
-        return isEnabled(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE);
-    }
-    
-    /**
-     * Accessor for getting bean description that only contains class
-     * annotations: useful if no getter/setter/creator information is needed.
-     */
-    @Override
-    public BeanDescription introspectClassAnnotations(JavaType type) {
-        return getClassIntrospector().forClassAnnotations(this, type, this);
-    }
-
-    /**
-     * Accessor for getting bean description that only contains immediate class
-     * annotations: ones from the class, and its direct mix-in, if any, but
-     * not from super types.
-     */
-    @Override
-    public BeanDescription introspectDirectClassAnnotations(JavaType type) {
-        return getClassIntrospector().forDirectClassAnnotations(this, type, this);
-    }
-
-    @Override
-    public VisibilityChecker<?> getDefaultVisibilityChecker()
-    {
-        VisibilityChecker<?> vchecker = super.getDefaultVisibilityChecker();
-        if (!isEnabled(MapperConfig.Feature.AUTO_DETECT_SETTERS)) {
-            vchecker = vchecker.withSetterVisibility(Visibility.NONE);
-        }
-        if (!isEnabled(MapperConfig.Feature.AUTO_DETECT_CREATORS)) {
-            vchecker = vchecker.withCreatorVisibility(Visibility.NONE);
-        }
-        if (!isEnabled(MapperConfig.Feature.AUTO_DETECT_FIELDS)) {
-            vchecker = vchecker.withFieldVisibility(Visibility.NONE);
-        }
-        return vchecker;
-    }
-
-    public final boolean isEnabled(DeserializationConfig.Feature f) {
-        return (_deserFeatures & f.getMask()) != 0;
-    }
-
-    /*
-    /**********************************************************
-    /* Other configuration
-    /**********************************************************
-     */
-
-    public final int getDeserializationFeatures() {
-        return _deserFeatures;
-    }
-    
-    /**
-     * Method for getting head of the problem handler chain. May be null,
-     * if no handlers have been added.
-     */
-    public LinkedNode<DeserializationProblemHandler> getProblemHandlers() {
-        return _problemHandlers;
-    }
-    
-    /**
-     * Method called during deserialization if Base64 encoded content
-     * needs to be decoded. Default version just returns default Jackson
-     * uses, which is modified-mime which does not add linefeeds (because
-     * those would have to be escaped in JSON strings).
-     */
-    public Base64Variant getBase64Variant() {
-        return Base64Variants.getDefaultVariant();
-    }
-
-    public final JsonNodeFactory getNodeFactory() {
-        return _nodeFactory;
-    }
-    
-    /*
-    /**********************************************************
-    /* Introspection methods
-    /**********************************************************
-     */
-
-    /**
-     * Method that will introspect full bean properties for the purpose
-     * of building a bean deserializer
-     *
-     * @param type Type of class to be introspected
-     */
-    @SuppressWarnings("unchecked")
-    public <T extends BeanDescription> T introspect(JavaType type) {
-        return (T) getClassIntrospector().forDeserialization(this, type, this);
-    }
-
-    /**
-     * Method that will introspect subset of bean properties needed to
-     * construct bean instance.
-     */
-    @SuppressWarnings("unchecked")
-    public <T extends BeanDescription> T introspectForCreation(JavaType type) {
-        return (T) getClassIntrospector().forCreation(this, type, this);
-    }
-}
diff --git a/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java b/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java
index 2fcc9ae..54c44cb 100644
--- a/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java
+++ b/src/main/java/com/fasterxml/jackson/databind/DeserializationContext.java
@@ -8,7 +8,8 @@
 import com.fasterxml.jackson.core.*;
 
 import com.fasterxml.jackson.databind.annotation.NoClass;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
+import com.fasterxml.jackson.databind.cfg.HandlerInstantiator;
 import com.fasterxml.jackson.databind.deser.*;
 import com.fasterxml.jackson.databind.deser.impl.DeserializerCache;
 import com.fasterxml.jackson.databind.deser.impl.TypeWrappedDeserializer;
@@ -182,14 +183,14 @@
      * Convenience method for checking whether specified on/off
      * feature is enabled
      */
-    public final boolean isEnabled(DeserializationConfig.Feature feat) {
+    public final boolean isEnabled(DeserializationFeature feat) {
         /* 03-Dec-2010, tatu: minor shortcut; since this is called quite often,
          *   let's use a local copy of feature settings:
          */
         return (_featureFlags & feat.getMask()) != 0;
     }
 
-    public final boolean isEnabled(MapperConfig.Feature feat) {
+    public final boolean isEnabled(MapperFeature feat) {
         return _config.isEnabled(feat);
     }
     
diff --git a/src/main/java/com/fasterxml/jackson/databind/DeserializationFeature.java b/src/main/java/com/fasterxml/jackson/databind/DeserializationFeature.java
new file mode 100644
index 0000000..bc868c2
--- /dev/null
+++ b/src/main/java/com/fasterxml/jackson/databind/DeserializationFeature.java
@@ -0,0 +1,210 @@
+package com.fasterxml.jackson.databind;
+
+import com.fasterxml.jackson.databind.cfg.ConfigFeature;
+
+/**
+ * Enumeration that defines simple on/off features that affect
+ * the way Java objects are deserialized from JSON
+ *<p>
+ * Note that features can be set both through
+ * {@link ObjectMapper} (as sort of defaults) and through
+ * {@link ObjectReader}.
+ * In first case these defaults must follow "config-then-use" patterns
+ * (i.e. defined once, not changed afterwards); all per-call
+ * changes must be done using {@link ObjectReader}.
+ */
+public enum DeserializationFeature implements ConfigFeature
+{
+    /*
+    /******************************************************
+    /* Type conversion features
+    /******************************************************
+     */
+
+    /**
+     * SerializationFeature that determines whether JSON floating point numbers
+     * are to be deserialized into {@link java.math.BigDecimal}s
+     * if only generic type description (either {@link Object} or
+     * {@link Number}, or within untyped {@link java.util.Map}
+     * or {@link java.util.Collection} context) is available.
+     * If enabled such values will be deserialized as {@link java.math.BigDecimal}s;
+     * if disabled, will be deserialized as {@link Double}s.
+     * <p>
+     * SerializationFeature is disabled by default, meaning that "untyped" floating
+     * point numbers will by default be deserialized as {@link Double}s
+     * (choice is for performance reason -- BigDecimals are slower than
+     * Doubles).
+     */
+    USE_BIG_DECIMAL_FOR_FLOATS(false),
+
+    /**
+     * SerializationFeature that determines whether JSON integral (non-floating-point)
+     * numbers are to be deserialized into {@link java.math.BigInteger}s
+     * if only generic type description (either {@link Object} or
+     * {@link Number}, or within untyped {@link java.util.Map}
+     * or {@link java.util.Collection} context) is available.
+     * If enabled such values will be deserialized as
+     * {@link java.math.BigInteger}s;
+     * if disabled, will be deserialized as "smallest" available type,
+     * which is either {@link Integer}, {@link Long} or
+     * {@link java.math.BigInteger}, depending on number of digits.
+     * <p>
+     * SerializationFeature is disabled by default, meaning that "untyped" floating
+     * point numbers will by default be deserialized using whatever
+     * is the most compact integral type, to optimize efficiency.
+     */
+    USE_BIG_INTEGER_FOR_INTS(false),
+
+    // [JACKSON-652]
+    /**
+     * SerializationFeature that determines whether JSON Array is mapped to
+     * <code>Object[]</code> or <code>List&lt;Object></code> when binding
+     * "untyped" objects (ones with nominal type of <code>java.lang.Object</code>).
+     * If true, binds as <code>Object[]</code>; if false, as <code>List&lt;Object></code>.
+     *<p>
+     * SerializationFeature is disabled by default, meaning that JSON arrays are bound as
+     * {@link java.util.List}s.
+     */
+    USE_JAVA_ARRAY_FOR_JSON_ARRAY(false),
+    
+    /**
+     * SerializationFeature that determines standard deserialization mechanism used for
+     * Enum values: if enabled, Enums are assumed to have been serialized  using
+     * return value of <code>Enum.toString()</code>;
+     * if disabled, return value of <code>Enum.name()</code> is assumed to have been used.
+     *<p>
+     * Note: this feature should usually have same value
+     * as {@link SerializationConfig.SerializationFeature#WRITE_ENUMS_USING_TO_STRING}.
+     *<p>
+     * SerializationFeature is disabled by default.
+     */
+    READ_ENUMS_USING_TO_STRING(false),
+    
+    /*
+    /******************************************************
+     *  Error handling features
+    /******************************************************
+     */
+
+    /**
+     * SerializationFeature that determines whether encountering of unknown
+     * properties (ones that do not map to a property, and there is
+     * no "any setter" or handler that can handle it)
+     * should result in a failure (by throwing a
+     * {@link JsonMappingException}) or not.
+     * This setting only takes effect after all other handling
+     * methods for unknown properties have been tried, and
+     * property remains unhandled.
+     *<p>
+     * SerializationFeature is enabled by default (meaning that a
+     * {@link JsonMappingException} will be thrown if an unknown property
+     * is encountered).
+     */
+    FAIL_ON_UNKNOWN_PROPERTIES(true),
+
+    /**
+     * SerializationFeature that determines whether encountering of JSON null
+     * is an error when deserializing into Java primitive types
+     * (like 'int' or 'double'). If it is, a JsonProcessingException
+     * is thrown to indicate this; if not, default value is used
+     * (0 for 'int', 0.0 for double, same defaulting as what JVM uses).
+     *<p>
+     * SerializationFeature is disabled by default.
+     */
+    FAIL_ON_NULL_FOR_PRIMITIVES(false),
+
+    /**
+     * SerializationFeature that determines whether JSON integer numbers are valid
+     * values to be used for deserializing Java enum values.
+     * If set to 'false' numbers are acceptable and are used to map to
+     * ordinal() of matching enumeration value; if 'true', numbers are
+     * not allowed and a {@link JsonMappingException} will be thrown.
+     * Latter behavior makes sense if there is concern that accidental
+     * mapping from integer values to enums might happen (and when enums
+     * are always serialized as JSON Strings)
+     *<p>
+     * SerializationFeature is disabled by default.
+     */
+    FAIL_ON_NUMBERS_FOR_ENUMS(false),
+
+    /**
+     * SerializationFeature that determines whether Jackson code should catch
+     * and wrap {@link Exception}s (but never {@link Error}s!)
+     * to add additional information about
+     * location (within input) of problem or not. If enabled,
+     * most exceptions will be caught and re-thrown (exception
+     * specifically being that {@link java.io.IOException}s may be passed
+     * as is, since they are declared as throwable); this can be
+     * convenient both in that all exceptions will be checked and
+     * declared, and so there is more contextual information.
+     * However, sometimes calling application may just want "raw"
+     * unchecked exceptions passed as is.
+     *<p>
+     * SerializationFeature is enabled by default.
+     */
+    WRAP_EXCEPTIONS(true),
+    
+    /*
+    /******************************************************
+     *  Structural conversion features
+    /******************************************************
+     */
+
+    /**
+     * SerializationFeature that determines whether it is acceptable to coerce non-array
+     * (in JSON) values to work with Java collection (arrays, java.util.Collection)
+     * types. If enabled, collection deserializers will try to handle non-array
+     * values as if they had "implicit" surrounding JSON array.
+     * This feature is meant to be used for compatibility/interoperability reasons,
+     * to work with packages (such as XML-to-JSON converters) that leave out JSON
+     * array in cases where there is just a single element in array.
+     *<p>
+     * SerializationFeature is disabled by default.
+     */
+    ACCEPT_SINGLE_VALUE_AS_ARRAY(false),
+    
+    /**
+     * SerializationFeature to allow "unwrapping" root-level JSON value, to match setting of
+     * {@link SerializationConfig.SerializationFeature#WRAP_ROOT_VALUE} used for serialization.
+     * Will verify that the root JSON value is a JSON Object, and that it has
+     * a single property with expected root name. If not, a
+     * {@link JsonMappingException} is thrown; otherwise value of the wrapped property
+     * will be deserialized as if it was the root value.
+     *<p>
+     * SerializationFeature is disabled by default.
+     */
+    UNWRAP_ROOT_VALUE(false),
+
+    /*
+    /******************************************************
+    /* Value conversion features
+    /******************************************************
+     */
+    
+    /**
+     * SerializationFeature that can be enabled to allow JSON empty String
+     * value ("") to be bound to POJOs as null.
+     * If disabled, standard POJOs can only be bound from JSON null or
+     * JSON Object (standard meaning that no custom deserializers or
+     * constructors are defined; both of which can add support for other
+     * kinds of JSON values); if enable, empty JSON String can be taken
+     * to be equivalent of JSON null.
+     *<p>
+     * SerializationFeature is enabled by default.
+     */
+    ACCEPT_EMPTY_STRING_AS_NULL_OBJECT(false)
+    
+    ;
+
+    private final boolean _defaultState;
+    
+    private DeserializationFeature(boolean defaultState) {
+        _defaultState = defaultState;
+    }
+
+    @Override
+    public boolean enabledByDefault() { return _defaultState; }
+
+    @Override
+    public int getMask() { return (1 << ordinal()); }
+}
\ No newline at end of file
diff --git a/src/main/java/com/fasterxml/jackson/databind/MapperFeature.java b/src/main/java/com/fasterxml/jackson/databind/MapperFeature.java
new file mode 100644
index 0000000..6b97276
--- /dev/null
+++ b/src/main/java/com/fasterxml/jackson/databind/MapperFeature.java
@@ -0,0 +1,240 @@
+package com.fasterxml.jackson.databind;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.cfg.ConfigFeature;
+
+/**
+ * Enumeration that defines simple on/off features to set
+ * for {@link ObjectMapper}, and accessible (but not changeable)
+ * via {@link ObjectReader} and {@link ObjectWriter} (as well as
+ * through various convenience methods through context objects).
+ *<p>
+ * Note that in addition to being only mutable via {@link ObjectMapper},
+ * changes only take effect when done <b>before any serialization or
+ * deserialization</b> calls -- that is, caller must follow
+ * "configure-then-use" pattern.
+ */
+public enum MapperFeature implements ConfigFeature
+{
+    /*
+    /******************************************************
+    /*  Introspection features
+    /******************************************************
+     */
+    
+    /**
+     * Feature that determines whether annotation introspection
+     * is used for configuration; if enabled, configured
+     * {@link AnnotationIntrospector} will be used: if disabled,
+     * no annotations are considered.
+     *<p>
+     * Feature is enabled by default.
+     */
+    USE_ANNOTATIONS(true),
+
+    /**
+     * Feature that determines whether "creator" methods are
+     * automatically detected by consider public constructors,
+     * and static single argument methods with name "valueOf".
+     * If disabled, only methods explicitly annotated are considered
+     * creator methods (except for the no-arg default constructor which
+     * is always considered a factory method).
+     *<p>
+     * Note that this feature has lower precedence than per-class
+     * annotations, and is only used if there isn't more granular
+     * configuration available.
+     *<P>
+     * Feature is enabled by default.
+     */
+    AUTO_DETECT_CREATORS(true),
+    
+    /**
+     * Feature that determines whether non-static fields are recognized as
+     * properties.
+     * If yes, then all public member fields
+     * are considered as properties. If disabled, only fields explicitly
+     * annotated are considered property fields.
+     *<p>
+     * Note that this feature has lower precedence than per-class
+     * annotations, and is only used if there isn't more granular
+     * configuration available.
+     *<p>
+     * Feature is enabled by default.
+     */
+     AUTO_DETECT_FIELDS(true),
+    
+    /**
+     * Feature that determines whether regualr "getter" methods are
+     * automatically detected based on standard Bean naming convention
+     * or not. If yes, then all public zero-argument methods that
+     * start with prefix "get" 
+     * are considered as getters.
+     * If disabled, only methods explicitly  annotated are considered getters.
+     *<p>
+     * Note that since version 1.3, this does <b>NOT</b> include
+     * "is getters" (see {@link #AUTO_DETECT_IS_GETTERS} for details)
+     *<p>
+     * Note that this feature has lower precedence than per-class
+     * annotations, and is only used if there isn't more granular
+     * configuration available.
+     *<p>
+     * Feature is enabled by default.
+     */
+    AUTO_DETECT_GETTERS(true),
+
+    /**
+     * Feature that determines whether "is getter" methods are
+     * automatically detected based on standard Bean naming convention
+     * or not. If yes, then all public zero-argument methods that
+     * start with prefix "is", and whose return type is boolean
+     * are considered as "is getters".
+     * If disabled, only methods explicitly annotated are considered getters.
+     *<p>
+     * Note that this feature has lower precedence than per-class
+     * annotations, and is only used if there isn't more granular
+     * configuration available.
+     *<p>
+     * Feature is enabled by default.
+     */
+    AUTO_DETECT_IS_GETTERS(true),
+
+     /**
+      * Feature that determines whether "setter" methods are
+      * automatically detected based on standard Bean naming convention
+      * or not. If yes, then all public one-argument methods that
+      * start with prefix "set"
+      * are considered setters. If disabled, only methods explicitly
+      * annotated are considered setters.
+      *<p>
+      * Note that this feature has lower precedence than per-class
+      * annotations, and is only used if there isn't more granular
+      * configuration available.
+      *<P>
+      * Feature is enabled by default.
+      */
+     AUTO_DETECT_SETTERS(true),
+     
+     /**
+      * Feature that determines whether getters (getter methods)
+      * can be auto-detected if there is no matching mutator (setter,
+      * constructor parameter or field) or not: if set to true,
+      * only getters that match a mutator are auto-discovered; if
+      * false, all auto-detectable getters can be discovered.
+      *<p>
+      * Feature is disabled by default.
+      */
+     REQUIRE_SETTERS_FOR_GETTERS(false),
+
+     /**
+      * Feature that determines whether otherwise regular "getter"
+      * methods (but only ones that handle Collections and Maps,
+      * not getters of other type)
+      * can be used for purpose of getting a reference to a Collection
+      * and Map to modify the property, without requiring a setter
+      * method.
+      * This is similar to how JAXB framework sets Collections and
+      * Maps: no setter is involved, just setter.
+      *<p>
+      * Note that such getters-as-setters methods have lower
+      * precedence than setters, so they are only used if no
+      * setter is found for the Map/Collection property.
+      *<p>
+      * Feature is enabled by default.
+      */
+     USE_GETTERS_AS_SETTERS(true),
+
+     /**
+     * Feature that determines whether method and field access
+     * modifier settings can be overridden when accessing
+     * properties. If enabled, method
+     * {@link java.lang.reflect.AccessibleObject#setAccessible}
+     * may be called to enable access to otherwise unaccessible
+     * objects.
+     *<p>
+     * Feature is enabled by default.
+     */
+    CAN_OVERRIDE_ACCESS_MODIFIERS(true),
+
+    /*
+    /******************************************************
+    /* Type-handling features
+    /******************************************************
+     */
+
+    /**
+     * SerializationFeature that determines whether the type detection for
+     * serialization should be using actual dynamic runtime type,
+     * or declared static type.
+     * Note that deserialization always uses declared static types
+     * since no runtime types are available (as we are creating
+     * instances after using type information).
+     *<p>
+     * This global default value can be overridden at class, method
+     * or field level by using {@link JsonSerialize#typing} annotation
+     * property.
+     *<p>
+     * Feature is disabled by default which means that dynamic runtime types
+     * are used (instead of declared static types) for serialization.
+     */
+    USE_STATIC_TYPING(false),
+
+    /*
+    /******************************************************
+    /* View-related features
+    /******************************************************
+     */
+    
+    /**
+     * SerializationFeature that determines whether properties that have no view
+     * annotations are included in JSON serialization views (see
+     * {@link com.fasterxml.jackson.annotation.JsonView} for more
+     * details on JSON Views).
+     * If enabled, non-annotated properties will be included;
+     * when disabled, they will be excluded. So this feature
+     * changes between "opt-in" (feature disabled) and
+     * "opt-out" (feature enabled) modes.
+     *<p>
+     * Default value is enabled, meaning that non-annotated
+     * properties are included in all views if there is no
+     * {@link com.fasterxml.jackson.annotation.JsonView} annotation.
+     *<p>
+     * Feature is enabled by default.
+     */
+    DEFAULT_VIEW_INCLUSION(true),
+    
+    /*
+    /******************************************************
+    /* Generic output features
+    /******************************************************
+     */
+
+    /**
+     * SerializationFeature that defines default property serialization order used
+     * for POJO fields (note: does <b>not</b> apply to {@link java.util.Map}
+     * serialization!):
+     * if enabled, default ordering is alphabetic (similar to
+     * how {@link com.fasterxml.jackson.annotation.JsonPropertyOrder#alphabetic()}
+     * works); if disabled, order is unspecified (based on what JDK gives
+     * us, which may be declaration order, but is not guaranteed).
+     *<p>
+     * Note that this is just the default behavior, and can be overridden by
+     * explicit overrides in classes.
+     *<p>
+     * Feature is disabled by default.
+     */
+    SORT_PROPERTIES_ALPHABETICALLY(false)
+
+    ;
+
+    private final boolean _defaultState;
+    
+    private MapperFeature(boolean defaultState) {
+        _defaultState = defaultState;
+    }
+    
+    @Override
+    public boolean enabledByDefault() { return _defaultState; }
+
+    @Override
+    public int getMask() { return (1 << ordinal()); }
+}
\ No newline at end of file
diff --git a/src/main/java/com/fasterxml/jackson/databind/Module.java b/src/main/java/com/fasterxml/jackson/databind/Module.java
index 2bc6356..90506cd 100644
--- a/src/main/java/com/fasterxml/jackson/databind/Module.java
+++ b/src/main/java/com/fasterxml/jackson/databind/Module.java
@@ -1,7 +1,6 @@
 package com.fasterxml.jackson.databind;
 
 import com.fasterxml.jackson.core.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier;
 import com.fasterxml.jackson.databind.deser.Deserializers;
 import com.fasterxml.jackson.databind.deser.KeyDeserializers;
@@ -114,11 +113,11 @@
          */
         public TypeFactory getTypeFactory();
         
-        public boolean isEnabled(MapperConfig.Feature f);
+        public boolean isEnabled(MapperFeature f);
         
-        public boolean isEnabled(DeserializationConfig.Feature f);
+        public boolean isEnabled(DeserializationFeature f);
 
-        public boolean isEnabled(SerializationConfig.Feature f);
+        public boolean isEnabled(SerializationFeature f);
 
         public boolean isEnabled(JsonFactory.Feature f);
         
diff --git a/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java b/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java
index a1e0b7b..0fcbd4c 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java
@@ -18,7 +18,11 @@
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.core.util.*;
 import com.fasterxml.jackson.databind.cfg.BaseSettings;
+import com.fasterxml.jackson.databind.cfg.DatabindVersion;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
+import com.fasterxml.jackson.databind.cfg.HandlerInstantiator;
 import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.deser.*;
 import com.fasterxml.jackson.databind.introspect.BasicClassIntrospector;
 import com.fasterxml.jackson.databind.introspect.ClassIntrospector;
@@ -478,17 +482,17 @@
             }
             
             @Override
-            public boolean isEnabled(MapperConfig.Feature f) {
+            public boolean isEnabled(MapperFeature f) {
                 return mapper.isEnabled(f);
             }
 
             @Override
-            public boolean isEnabled(DeserializationConfig.Feature f) {
+            public boolean isEnabled(DeserializationFeature f) {
                 return mapper.isEnabled(f);
             }
             
             @Override
-            public boolean isEnabled(SerializationConfig.Feature f) {
+            public boolean isEnabled(SerializationFeature f) {
                 return mapper.isEnabled(f);
             }
 
@@ -1073,7 +1077,7 @@
      * Method for changing state of an on/off mapper feature for
      * this mapper instance.
      */
-    public ObjectMapper configure(MapperConfig.Feature f, boolean state) {
+    public ObjectMapper configure(MapperFeature f, boolean state) {
         _serializationConfig = state ?
                 _serializationConfig.with(f) : _serializationConfig.without(f);
         _deserializationConfig = state ?
@@ -1085,7 +1089,7 @@
      * Method for changing state of an on/off serialization feature for
      * this object mapper.
      */
-    public ObjectMapper configure(SerializationConfig.Feature f, boolean state) {
+    public ObjectMapper configure(SerializationFeature f, boolean state) {
         _serializationConfig = state ?
                 _serializationConfig.with(f) : _serializationConfig.without(f);
         return this;
@@ -1095,7 +1099,7 @@
      * Method for changing state of an on/off deserialization feature for
      * this object mapper.
      */
-    public ObjectMapper configure(DeserializationConfig.Feature f, boolean state) {
+    public ObjectMapper configure(DeserializationFeature f, boolean state) {
         _deserializationConfig = state ?
                 _deserializationConfig.with(f) : _deserializationConfig.without(f);
         return this;
@@ -1133,7 +1137,7 @@
      * Method for enabling specified {@link MapperConfig} features.
      * Modifies and returns this instance; no new object is created.
      */
-    public ObjectMapper enable(MapperConfig.Feature... f) {
+    public ObjectMapper enable(MapperFeature... f) {
         _deserializationConfig = _deserializationConfig.with(f);
         _serializationConfig = _serializationConfig.with(f);
         return this;
@@ -1143,7 +1147,7 @@
      * Method for enabling specified {@link DeserializationConfig} features.
      * Modifies and returns this instance; no new object is created.
      */
-    public ObjectMapper disable(MapperConfig.Feature... f) {
+    public ObjectMapper disable(MapperFeature... f) {
         _deserializationConfig = _deserializationConfig.without(f);
         _serializationConfig = _serializationConfig.without(f);
         return this;
@@ -1153,7 +1157,7 @@
      * Method for enabling specified {@link DeserializationConfig} features.
      * Modifies and returns this instance; no new object is created.
      */
-    public ObjectMapper enable(DeserializationConfig.Feature feature) {
+    public ObjectMapper enable(DeserializationFeature feature) {
         _deserializationConfig = _deserializationConfig.with(feature);
         return this;
     }
@@ -1162,8 +1166,8 @@
      * Method for enabling specified {@link DeserializationConfig} features.
      * Modifies and returns this instance; no new object is created.
      */
-    public ObjectMapper enable(DeserializationConfig.Feature first,
-            DeserializationConfig.Feature... f) {
+    public ObjectMapper enable(DeserializationFeature first,
+            DeserializationFeature... f) {
         _deserializationConfig = _deserializationConfig.with(first, f);
         return this;
     }
@@ -1172,7 +1176,7 @@
      * Method for enabling specified {@link DeserializationConfig} features.
      * Modifies and returns this instance; no new object is created.
      */
-    public ObjectMapper disable(DeserializationConfig.Feature feature) {
+    public ObjectMapper disable(DeserializationFeature feature) {
         _deserializationConfig = _deserializationConfig.without(feature);
         return this;
     }
@@ -1181,8 +1185,8 @@
      * Method for enabling specified {@link DeserializationConfig} features.
      * Modifies and returns this instance; no new object is created.
      */
-    public ObjectMapper disable(DeserializationConfig.Feature first,
-            DeserializationConfig.Feature... f) {
+    public ObjectMapper disable(DeserializationFeature first,
+            DeserializationFeature... f) {
         _deserializationConfig = _deserializationConfig.without(first, f);
         return this;
     }
@@ -1191,7 +1195,7 @@
      * Method for enabling specified {@link DeserializationConfig} feature.
      * Modifies and returns this instance; no new object is created.
      */
-    public ObjectMapper enable(SerializationConfig.Feature f) {
+    public ObjectMapper enable(SerializationFeature f) {
         _serializationConfig = _serializationConfig.with(f);
         return this;
     }
@@ -1200,8 +1204,8 @@
      * Method for enabling specified {@link DeserializationConfig} features.
      * Modifies and returns this instance; no new object is created.
      */
-    public ObjectMapper enable(SerializationConfig.Feature first,
-            SerializationConfig.Feature... f) {
+    public ObjectMapper enable(SerializationFeature first,
+            SerializationFeature... f) {
         _serializationConfig = _serializationConfig.with(first, f);
         return this;
     }
@@ -1210,7 +1214,7 @@
      * Method for enabling specified {@link DeserializationConfig} features.
      * Modifies and returns this instance; no new object is created.
      */
-    public ObjectMapper disable(SerializationConfig.Feature f) {
+    public ObjectMapper disable(SerializationFeature f) {
         _serializationConfig = _serializationConfig.without(f);
         return this;
     }
@@ -1219,8 +1223,8 @@
      * Method for enabling specified {@link DeserializationConfig} features.
      * Modifies and returns this instance; no new object is created.
      */
-    public ObjectMapper disable(SerializationConfig.Feature first,
-            SerializationConfig.Feature... f) {
+    public ObjectMapper disable(SerializationFeature first,
+            SerializationFeature... f) {
         _serializationConfig = _serializationConfig.without(first, f);
         return this;
     }
@@ -1229,7 +1233,7 @@
      * Method for checking whether given Mapper
      * feature is enabled.
      */
-    public boolean isEnabled(MapperConfig.Feature f) {
+    public boolean isEnabled(MapperFeature f) {
         // ok to use either one, should be kept in sync
         return _serializationConfig.isEnabled(f);
     }
@@ -1238,7 +1242,7 @@
      * Method for checking whether given serialization-specific
      * feature is enabled.
      */
-    public boolean isEnabled(SerializationConfig.Feature f) {
+    public boolean isEnabled(SerializationFeature f) {
         return _serializationConfig.isEnabled(f);
     }
     
@@ -1246,7 +1250,7 @@
      * Method for checking whether given deserialization-specific
      * feature is enabled.
      */
-    public boolean isEnabled(DeserializationConfig.Feature f) {
+    public boolean isEnabled(DeserializationFeature f) {
         return _deserializationConfig.isEnabled(f);
     }
 
@@ -1553,11 +1557,11 @@
         throws IOException, JsonGenerationException, JsonMappingException
     {
         SerializationConfig config = getSerializationConfig();
-        if (config.isEnabled(SerializationConfig.Feature.CLOSE_CLOSEABLE) && (value instanceof Closeable)) {
+        if (config.isEnabled(SerializationFeature.CLOSE_CLOSEABLE) && (value instanceof Closeable)) {
             _writeCloseableValue(jgen, value, config);
         } else {
             _serializerProvider(config).serializeValue(jgen, value);
-            if (config.isEnabled(SerializationConfig.Feature.FLUSH_AFTER_WRITE_VALUE)) {
+            if (config.isEnabled(SerializationFeature.FLUSH_AFTER_WRITE_VALUE)) {
                 jgen.flush();
             }
         }
@@ -1572,7 +1576,7 @@
     {
         SerializationConfig config = getSerializationConfig();
         _serializerProvider(config).serializeValue(jgen, rootNode);
-        if (config.isEnabled(SerializationConfig.Feature.FLUSH_AFTER_WRITE_VALUE)) {
+        if (config.isEnabled(SerializationFeature.FLUSH_AFTER_WRITE_VALUE)) {
             jgen.flush();
         }
     }
@@ -1979,7 +1983,7 @@
      * specified feature enabled (compared to settings that this
      * mapper instance has).
      */
-    public ObjectWriter writer(SerializationConfig.Feature feature) {
+    public ObjectWriter writer(SerializationFeature feature) {
         return new ObjectWriter(this, getSerializationConfig().with(feature));
     }
 
@@ -1988,8 +1992,8 @@
      * specified features enabled (compared to settings that this
      * mapper instance has).
      */
-    public ObjectWriter writer(SerializationConfig.Feature first,
-            SerializationConfig.Feature... other) {
+    public ObjectWriter writer(SerializationFeature first,
+            SerializationFeature... other) {
         return new ObjectWriter(this, getSerializationConfig().with(first, other));
     }
     
@@ -2106,7 +2110,7 @@
      * Note that the resulting instance is NOT usable as is,
      * without defining expected value type.
      */
-    public ObjectReader reader(DeserializationConfig.Feature feature) {
+    public ObjectReader reader(DeserializationFeature feature) {
         return new ObjectReader(this, getDeserializationConfig().with(feature));
     }
 
@@ -2117,8 +2121,8 @@
      * Note that the resulting instance is NOT usable as is,
      * without defining expected value type.
      */
-    public ObjectReader reader(DeserializationConfig.Feature first,
-            DeserializationConfig.Feature... other) {
+    public ObjectReader reader(DeserializationFeature first,
+            DeserializationFeature... other) {
         return new ObjectReader(this, getDeserializationConfig().with(first, other));
     }
     
@@ -2266,7 +2270,7 @@
         try {
             // inlined 'writeValue' with minor changes:
             // first: disable wrapping when writing
-            SerializationConfig config = getSerializationConfig().without(SerializationConfig.Feature.WRAP_ROOT_VALUE);
+            SerializationConfig config = getSerializationConfig().without(SerializationFeature.WRAP_ROOT_VALUE);
             // no need to check for closing of TokenBuffer
             _serializerProvider(config).serializeValue(buf, fromValue);
 
@@ -2343,11 +2347,11 @@
     {
         SerializationConfig cfg = getSerializationConfig();
         // [JACKSON-96]: allow enabling pretty printing for ObjectMapper directly
-        if (cfg.isEnabled(SerializationConfig.Feature.INDENT_OUTPUT)) {
+        if (cfg.isEnabled(SerializationFeature.INDENT_OUTPUT)) {
             jgen.useDefaultPrettyPrinter();
         }
         // [JACKSON-282]: consider Closeable
-        if (cfg.isEnabled(SerializationConfig.Feature.CLOSE_CLOSEABLE) && (value instanceof Closeable)) {
+        if (cfg.isEnabled(SerializationFeature.CLOSE_CLOSEABLE) && (value instanceof Closeable)) {
             _configAndWriteCloseable(jgen, value, cfg);
             return;
         }
@@ -2372,11 +2376,11 @@
         throws IOException, JsonGenerationException, JsonMappingException
     {
         SerializationConfig cfg = getSerializationConfig().withView(viewClass);
-        if (cfg.isEnabled(SerializationConfig.Feature.INDENT_OUTPUT)) {
+        if (cfg.isEnabled(SerializationFeature.INDENT_OUTPUT)) {
             jgen.useDefaultPrettyPrinter();
         }
         // [JACKSON-282]: consider Closeable
-        if (cfg.isEnabled(SerializationConfig.Feature.CLOSE_CLOSEABLE) && (value instanceof Closeable)) {
+        if (cfg.isEnabled(SerializationFeature.CLOSE_CLOSEABLE) && (value instanceof Closeable)) {
             _configAndWriteCloseable(jgen, value, cfg);
             return;
         }
@@ -2437,7 +2441,7 @@
         Closeable toClose = (Closeable) value;
         try {
             _serializerProvider(cfg).serializeValue(jgen, value);
-            if (cfg.isEnabled(SerializationConfig.Feature.FLUSH_AFTER_WRITE_VALUE)) {
+            if (cfg.isEnabled(SerializationFeature.FLUSH_AFTER_WRITE_VALUE)) {
                 jgen.flush();
             }
             Closeable tmpToClose = toClose;
diff --git a/src/main/java/com/fasterxml/jackson/databind/ObjectReader.java b/src/main/java/com/fasterxml/jackson/databind/ObjectReader.java
index 0aa2ae8..bffb613 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ObjectReader.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ObjectReader.java
@@ -10,7 +10,8 @@
 import com.fasterxml.jackson.core.type.ResolvedType;
 import com.fasterxml.jackson.core.type.TypeReference;
 
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.DatabindVersion;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.NullNode;
 import com.fasterxml.jackson.databind.node.TreeTraversingParser;
@@ -212,7 +213,7 @@
      * Method for constructing a new reader instance that is configured
      * with specified feature enabled.
      */
-    public ObjectReader with(DeserializationConfig.Feature feature) 
+    public ObjectReader with(DeserializationFeature feature) 
     {
         DeserializationConfig newConfig = _config.with(feature);
         return (newConfig == _config) ? this : new ObjectReader(this, newConfig);
@@ -222,8 +223,8 @@
      * Method for constructing a new reader instance that is configured
      * with specified features enabled.
      */
-    public ObjectReader with(DeserializationConfig.Feature first,
-            DeserializationConfig.Feature... other)
+    public ObjectReader with(DeserializationFeature first,
+            DeserializationFeature... other)
     {
         DeserializationConfig newConfig = _config.with(first, other);
         return (newConfig == _config) ? this : new ObjectReader(this, newConfig);
@@ -233,7 +234,7 @@
      * Method for constructing a new reader instance that is configured
      * with specified features enabled.
      */
-    public ObjectReader withFeatures(DeserializationConfig.Feature... features)
+    public ObjectReader withFeatures(DeserializationFeature... features)
     {
         DeserializationConfig newConfig = _config.withFeatures(features);
         return (newConfig == _config) ? this : new ObjectReader(this, newConfig);
@@ -243,7 +244,7 @@
      * Method for constructing a new reader instance that is configured
      * with specified feature disabled.
      */
-    public ObjectReader without(DeserializationConfig.Feature feature) 
+    public ObjectReader without(DeserializationFeature feature) 
     {
         DeserializationConfig newConfig = _config.without(feature);
         return (newConfig == _config) ? this : new ObjectReader(this, newConfig);
@@ -253,8 +254,8 @@
      * Method for constructing a new reader instance that is configured
      * with specified features disabled.
      */
-    public ObjectReader without(DeserializationConfig.Feature first,
-            DeserializationConfig.Feature... other)
+    public ObjectReader without(DeserializationFeature first,
+            DeserializationFeature... other)
     {
         DeserializationConfig newConfig = _config.without(first, other);
         return (newConfig == _config) ? this : new ObjectReader(this, newConfig);
@@ -264,7 +265,7 @@
      * Method for constructing a new reader instance that is configured
      * with specified features disabled.
      */
-    public ObjectReader withoutFeatures(DeserializationConfig.Feature... features)
+    public ObjectReader withoutFeatures(DeserializationFeature... features)
     {
         DeserializationConfig newConfig = _config.withoutFeatures(features);
         return (newConfig == _config) ? this : new ObjectReader(this, newConfig);
@@ -417,11 +418,11 @@
     /**********************************************************
      */
     
-    public boolean isEnabled(DeserializationConfig.Feature f) {
+    public boolean isEnabled(DeserializationFeature f) {
         return _config.isEnabled(f);
     }
 
-    public boolean isEnabled(MapperConfig.Feature f) {
+    public boolean isEnabled(MapperFeature f) {
         return _config.isEnabled(f);
     }
 
diff --git a/src/main/java/com/fasterxml/jackson/databind/ObjectWriter.java b/src/main/java/com/fasterxml/jackson/databind/ObjectWriter.java
index 1768396..8a9ca81 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ObjectWriter.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ObjectWriter.java
@@ -9,7 +9,8 @@
 import com.fasterxml.jackson.core.util.ByteArrayBuilder;
 import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
 import com.fasterxml.jackson.core.util.MinimalPrettyPrinter;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.DatabindVersion;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.ser.FilterProvider;
 import com.fasterxml.jackson.databind.ser.SerializerFactory;
 import com.fasterxml.jackson.databind.type.TypeFactory;
@@ -186,7 +187,7 @@
      * Method for constructing a new instance that is configured
      * with specified feature enabled.
      */
-    public ObjectWriter with(SerializationConfig.Feature feature) 
+    public ObjectWriter with(SerializationFeature feature) 
     {
         SerializationConfig newConfig = _config.with(feature);
         return (newConfig == _config) ? this : new ObjectWriter(this, newConfig);
@@ -196,8 +197,8 @@
      * Method for constructing a new instance that is configured
      * with specified features enabled.
      */
-    public ObjectWriter with(SerializationConfig.Feature first,
-            SerializationConfig.Feature... other)
+    public ObjectWriter with(SerializationFeature first,
+            SerializationFeature... other)
     {
         SerializationConfig newConfig = _config.with(first, other);
         return (newConfig == _config) ? this : new ObjectWriter(this, newConfig);
@@ -207,7 +208,7 @@
      * Method for constructing a new instance that is configured
      * with specified features enabled.
      */
-    public ObjectWriter withFeatures(SerializationConfig.Feature... features)
+    public ObjectWriter withFeatures(SerializationFeature... features)
     {
         SerializationConfig newConfig = _config.withFeatures(features);
         return (newConfig == _config) ? this : new ObjectWriter(this, newConfig);
@@ -217,7 +218,7 @@
      * Method for constructing a new instance that is configured
      * with specified feature enabled.
      */
-    public ObjectWriter without(SerializationConfig.Feature feature) 
+    public ObjectWriter without(SerializationFeature feature) 
     {
         SerializationConfig newConfig = _config.without(feature);
         return (newConfig == _config) ? this : new ObjectWriter(this, newConfig);
@@ -227,8 +228,8 @@
      * Method for constructing a new instance that is configured
      * with specified features enabled.
      */
-    public ObjectWriter without(SerializationConfig.Feature first,
-            SerializationConfig.Feature... other)
+    public ObjectWriter without(SerializationFeature first,
+            SerializationFeature... other)
     {
         SerializationConfig newConfig = _config.without(first, other);
         return (newConfig == _config) ? this : new ObjectWriter(this, newConfig);
@@ -238,7 +239,7 @@
      * Method for constructing a new instance that is configured
      * with specified features enabled.
      */
-    public ObjectWriter withoutFeatures(SerializationConfig.Feature... features)
+    public ObjectWriter withoutFeatures(SerializationFeature... features)
     {
         SerializationConfig newConfig = _config.withoutFeatures(features);
         return (newConfig == _config) ? this : new ObjectWriter(this, newConfig);
@@ -370,11 +371,11 @@
     /**********************************************************
      */
 
-    public boolean isEnabled(SerializationConfig.Feature f) {
+    public boolean isEnabled(SerializationFeature f) {
         return _config.isEnabled(f);
     }
 
-    public boolean isEnabled(MapperConfig.Feature f) {
+    public boolean isEnabled(MapperFeature f) {
         return _config.isEnabled(f);
     }
 
@@ -403,7 +404,7 @@
     public void writeValue(JsonGenerator jgen, Object value)
         throws IOException, JsonGenerationException, JsonMappingException
     {
-        if (_config.isEnabled(SerializationConfig.Feature.CLOSE_CLOSEABLE) && (value instanceof Closeable)) {
+        if (_config.isEnabled(SerializationFeature.CLOSE_CLOSEABLE) && (value instanceof Closeable)) {
             _writeCloseableValue(jgen, value, _config);
         } else {
             if (_rootType == null) {
@@ -411,7 +412,7 @@
             } else {
                 _serializerProvider(_config).serializeValue(jgen, value, _rootType);
             }
-            if (_config.isEnabled(SerializationConfig.Feature.FLUSH_AFTER_WRITE_VALUE)) {
+            if (_config.isEnabled(SerializationFeature.FLUSH_AFTER_WRITE_VALUE)) {
                 jgen.flush();
             }
         }
@@ -538,7 +539,7 @@
         if (_prettyPrinter != null) {
             PrettyPrinter pp = _prettyPrinter;
             jgen.setPrettyPrinter((pp == NULL_PRETTY_PRINTER) ? null : pp);
-        } else if (_config.isEnabled(SerializationConfig.Feature.INDENT_OUTPUT)) {
+        } else if (_config.isEnabled(SerializationFeature.INDENT_OUTPUT)) {
             jgen.useDefaultPrettyPrinter();
         }
         // [JACKSON-520]: add support for pass-through schema:
@@ -546,7 +547,7 @@
             jgen.setSchema(_schema);
         }
         // [JACKSON-282]: consider Closeable
-        if (_config.isEnabled(SerializationConfig.Feature.CLOSE_CLOSEABLE) && (value instanceof Closeable)) {
+        if (_config.isEnabled(SerializationFeature.CLOSE_CLOSEABLE) && (value instanceof Closeable)) {
             _configAndWriteCloseable(jgen, value, _config);
             return;
         }
@@ -626,7 +627,7 @@
             } else {
                 _serializerProvider(cfg).serializeValue(jgen, value, _rootType);
             }
-            if (_config.isEnabled(SerializationConfig.Feature.FLUSH_AFTER_WRITE_VALUE)) {
+            if (_config.isEnabled(SerializationFeature.FLUSH_AFTER_WRITE_VALUE)) {
                 jgen.flush();
             }
             Closeable tmpToClose = toClose;
diff --git a/src/main/java/com/fasterxml/jackson/databind/SerializationConfig.java b/src/main/java/com/fasterxml/jackson/databind/SerializationConfig.java
deleted file mode 100644
index 7a3622e..0000000
--- a/src/main/java/com/fasterxml/jackson/databind/SerializationConfig.java
+++ /dev/null
@@ -1,718 +0,0 @@
-package com.fasterxml.jackson.databind;
-
-import java.text.DateFormat;
-import java.util.*;
-
-import com.fasterxml.jackson.annotation.*;
-import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
-import com.fasterxml.jackson.databind.cfg.*;
-import com.fasterxml.jackson.databind.introspect.ClassIntrospector;
-import com.fasterxml.jackson.databind.introspect.VisibilityChecker;
-import com.fasterxml.jackson.databind.jsontype.SubtypeResolver;
-import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder;
-import com.fasterxml.jackson.databind.ser.FilterProvider;
-import com.fasterxml.jackson.databind.ser.SerializerFactory;
-import com.fasterxml.jackson.databind.type.ClassKey;
-import com.fasterxml.jackson.databind.type.TypeFactory;
-
-/**
- * Object that contains baseline configuration for serialization
- * process. An instance is owned by {@link ObjectMapper}, which
- * passes an immutable instance for serialization process to
- * {@link SerializerProvider} and {@link SerializerFactory}
- * (either directly, or through {@link ObjectWriter}.
- *<p>
- * Note that instances are considered immutable and as such no copies
- * should need to be created (there are some implementation details
- * with respect to mix-in annotations; where this is guaranteed as
- * long as caller follow "copy-then-use" pattern)
- */
-public final class SerializationConfig
-    extends MapperConfigBase<SerializationConfig.Feature, SerializationConfig>
-{
-    /**
-     * Enumeration that defines simple on/off features that affect
-     * the way Java objects are serialized.
-     *<p>
-     * Note that features can be set both through
-     * {@link ObjectMapper} (as sort of defaults) and through
-     * {@link ObjectWriter}.
-     * In first case these defaults must follow "config-then-use" patterns
-     * (i.e. defined once, not changed afterwards); all per-call
-     * changes must be done using {@link ObjectWriter}.
-     */
-    public enum Feature implements ConfigFeature
-    {
-        /*
-        /******************************************************
-        /* Generic output features
-        /******************************************************
-         */
-        
-        /**
-         * Feature that can be enabled to make root value (usually JSON
-         * Object but can be any type) wrapped within a single property
-         * JSON object, where key as the "root name", as determined by
-         * annotation introspector (esp. for JAXB that uses
-         * <code>@XmlRootElement.name</code>) or fallback (non-qualified
-         * class name).
-         * Feature is mostly intended for JAXB compatibility.
-         *<p>
-         * Feature is enabled by default.
-         */
-        WRAP_ROOT_VALUE(false),
-
-        /**
-         * Feature that allows enabling (or disabling) indentation
-         * for the underlying generator, using the default pretty
-         * printer (see
-         * {@link com.fasterxml.jackson.core.JsonGenerator#useDefaultPrettyPrinter}
-         * for details).
-         *<p>
-         * Note that this only affects cases where
-         * {@link com.fasterxml.jackson.core.JsonGenerator}
-         * is constructed implicitly by ObjectMapper: if explicit
-         * generator is passed, its configuration is not changed.
-         *<p>
-         * Also note that if you want to configure details of indentation,
-         * you need to directly configure the generator: there is a
-         * method to use any <code>PrettyPrinter</code> instance.
-         * This feature will only allow using the default implementation.
-         *<p>
-         * Feature is enabled by default.
-         */
-        INDENT_OUTPUT(false),
-        
-        /*
-        /******************************************************
-        /*  Error handling features
-        /******************************************************
-         */
-        
-        /**
-         * Feature that determines what happens when no accessors are
-         * found for a type (and there are no annotations to indicate
-         * it is meant to be serialized). If enabled (default), an
-         * exception is thrown to indicate these as non-serializable
-         * types; if disabled, they are serialized as empty Objects,
-         * i.e. without any properties.
-         *<p>
-         * Note that empty types that this feature has only effect on
-         * those "empty" beans that do not have any recognized annotations
-         * (like <code>@JsonSerialize</code>): ones that do have annotations
-         * do not result in an exception being thrown.
-         *<p>
-         * Feature is enabled by default.
-         */
-        FAIL_ON_EMPTY_BEANS(true),
-
-        /**
-         * Feature that determines whether Jackson code should catch
-         * and wrap {@link Exception}s (but never {@link Error}s!)
-         * to add additional information about
-         * location (within input) of problem or not. If enabled,
-         * most exceptions will be caught and re-thrown (exception
-         * specifically being that {@link java.io.IOException}s may be passed
-         * as is, since they are declared as throwable); this can be
-         * convenient both in that all exceptions will be checked and
-         * declared, and so there is more contextual information.
-         * However, sometimes calling application may just want "raw"
-         * unchecked exceptions passed as is.
-         *<p>
-         *<p>
-         * Feature is enabled by default.
-         */
-        WRAP_EXCEPTIONS(true),
-
-        /*
-        /******************************************************
-        /* Output life cycle features
-        /******************************************************
-         */
-        
-         /**
-          * Feature that determines whether <code>close</code> method of
-          * serialized <b>root level</b> objects (ones for which <code>ObjectMapper</code>'s
-          * writeValue() (or equivalent) method is called)
-          * that implement {@link java.io.Closeable} 
-          * is called after serialization or not. If enabled, <b>close()</b> will
-          * be called after serialization completes (whether succesfully, or
-          * due to an error manifested by an exception being thrown). You can
-          * think of this as sort of "finally" processing.
-          *<p>
-          * NOTE: only affects behavior with <b>root</b> objects, and not other
-          * objects reachable from the root object. Put another way, only one
-          * call will be made for each 'writeValue' call.
-         *<p>
-         * Feature is disabled by default.
-          */
-        CLOSE_CLOSEABLE(false),
-
-        /**
-         * Feature that determines whether <code>JsonGenerator.flush()</code> is
-         * called after <code>writeValue()</code> method <b>that takes JsonGenerator
-         * as an argument</b> completes (i.e. does NOT affect methods
-         * that use other destinations); same for methods in {@link ObjectWriter}.
-         * This usually makes sense; but there are cases where flushing
-         * should not be forced: for example when underlying stream is
-         * compressing and flush() causes compression state to be flushed
-         * (which occurs with some compression codecs).
-         *<p>
-         * Feature is enabled by default.
-         */
-        FLUSH_AFTER_WRITE_VALUE(true),
-         
-        /*
-        /******************************************************
-        /* Data type - specific serialization configuration
-        /******************************************************
-         */
-
-        /**
-         * Feature that determines whether {@link java.util.Date} values
-         * (and Date-based things like {@link java.util.Calendar}s) are to be
-         * serialized as numeric timestamps (true; the default),
-         * or as something else (usually textual representation).
-         * If textual representation is used, the actual format is
-         * one returned by a call to {@link #getDateFormat}.
-         *<p>
-         * Note: whether this feature affects handling of other date-related
-         * types depend on handlers of those types, although ideally they
-         * should use this feature
-         *<p>
-         * Note: whether {@link java.util.Map} keys are serialized as Strings
-         * or not is controlled using {@link #WRITE_DATE_KEYS_AS_TIMESTAMPS}.
-         *<p>
-         * Feature is enabled by default.
-         */
-        WRITE_DATES_AS_TIMESTAMPS(true),
-
-        /**
-         * Feature that determines whether {@link java.util.Date}s
-         * (and sub-types) used as {@link java.util.Map} keys are serialized
-         * as timestamps or not (if not, will be serialized as textual
-         * values).
-         *<p>
-         * Default value is 'false', meaning that Date-valued Map keys are serialized
-         * as textual (ISO-8601) values.
-         *<p>
-         * Feature is disabled by default.
-         */
-        WRITE_DATE_KEYS_AS_TIMESTAMPS(false),
-
-        /**
-         * Feature that determines how type <code>char[]</code> is serialized:
-         * when enabled, will be serialized as an explict JSON array (with
-         * single-character Strings as values); when disabled, defaults to
-         * serializing them as Strings (which is more compact).
-         *<p>
-         * Feature is disabled by default.
-         */
-        WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS(false),
-
-        /**
-         * Feature that determines standard serialization mechanism used for
-         * Enum values: if enabled, return value of <code>Enum.toString()</code>
-         * is used; if disabled, return value of <code>Enum.name()</code> is used.
-         *<p>
-         * Note: this feature should usually have same value
-         * as {@link DeserializationConfig.Feature#READ_ENUMS_USING_TO_STRING}.
-         *<p>
-         * Feature is disabled by default.
-         */
-        WRITE_ENUMS_USING_TO_STRING(false),
-
-        /**
-         * Feature that determines whethere Java Enum values are serialized
-         * as numbers (true), or textual values (false). If textual values are
-         * used, other settings are also considered.
-         * If this feature is enabled,
-         *  return value of <code>Enum.ordinal()</code>
-         * (an integer) will be used as the serialization.
-         *<p>
-         * Note that this feature has precedence over {@link #WRITE_ENUMS_USING_TO_STRING},
-         * which is only considered if this feature is set to false.
-         *<p>
-         * Feature is disabled by default.
-         */
-        WRITE_ENUMS_USING_INDEX(false),
-        
-        /**
-         * Feature that determines whether Map entries with null values are
-         * to be serialized (true) or not (false).
-         *<p>
-         * For further details, check out [JACKSON-314]
-         *<p>
-         * Feature is enabled by default.
-         */
-        WRITE_NULL_MAP_VALUES(true),
-
-        /**
-         * Feature that determines whether Container properties (POJO properties
-         * with declared value of Collection or array; i.e. things that produce JSON
-         * arrays) that are empty (have no elements)
-         * will be serialized as empty JSON arrays (true), or suppressed from output (false).
-         *<p>
-         * Note that this does not change behavior of {@link java.util.Map}s, or
-         * "Collection-like" types.
-         *<p>
-         * Feature is enabled by default.
-         */
-        WRITE_EMPTY_JSON_ARRAYS(true)
-        
-            ;
-
-        private final boolean _defaultState;
-        
-        private Feature(boolean defaultState) {
-            _defaultState = defaultState;
-        }
-        
-        @Override
-        public boolean enabledByDefault() { return _defaultState; }
-
-        @Override
-        public int getMask() { return (1 << ordinal()); }
-    }
-
-    /*
-    /**********************************************************
-    /* Serialization settings
-    /**********************************************************
-     */
-
-    /**
-     * Set of features enabled; actual type (kind of features)
-     * depends on sub-classes.
-     */
-    protected final int _serFeatures;
-    
-    /**
-     * Which Bean/Map properties are to be included in serialization?
-     * Default settings is to include all regardless of value; can be
-     * changed to only include non-null properties, or properties
-     * with non-default values.
-     */
-    protected JsonInclude.Include _serializationInclusion = null;
-    
-    /**
-     * Object used for resolving filter ids to filter instances.
-     * Non-null if explicitly defined; null by default.
-     */
-    protected final FilterProvider _filterProvider;
-    
-    /*
-    /**********************************************************
-    /* Life-cycle, constructors
-    /**********************************************************
-     */
-
-    /**
-     * Constructor used by ObjectMapper to create default configuration object instance.
-     */
-    public SerializationConfig(BaseSettings base,
-            SubtypeResolver str, Map<ClassKey,Class<?>> mixins)
-    {
-        super(base, str, mixins);
-        _serFeatures = collectFeatureDefaults(SerializationConfig.Feature.class);
-        _filterProvider = null;
-    }
-    
-    private SerializationConfig(SerializationConfig src, SubtypeResolver str)
-    {
-        super(src, str);
-        _serFeatures = src._serFeatures;
-        _serializationInclusion = src._serializationInclusion;
-        _filterProvider = src._filterProvider;
-    }
-
-    private SerializationConfig(SerializationConfig src,
-            int mapperFeatures, int serFeatures)
-    {
-        super(src, mapperFeatures);
-        _serFeatures = serFeatures;
-        _serializationInclusion = src._serializationInclusion;
-        _filterProvider = src._filterProvider;
-    }
-    
-    private SerializationConfig(SerializationConfig src, BaseSettings base)
-    {
-        super(src, base);
-        _serFeatures = src._serFeatures;
-        _serializationInclusion = src._serializationInclusion;
-        _filterProvider = src._filterProvider;
-    }
-
-    private SerializationConfig(SerializationConfig src, FilterProvider filters)
-    {
-        super(src);
-        _serFeatures = src._serFeatures;
-        _serializationInclusion = src._serializationInclusion;
-        _filterProvider = filters;
-    }
-
-    private SerializationConfig(SerializationConfig src, Class<?> view)
-    {
-        super(src, view);
-        _serFeatures = src._serFeatures;
-        _serializationInclusion = src._serializationInclusion;
-        _filterProvider = src._filterProvider;
-    }
-
-    private SerializationConfig(SerializationConfig src, JsonInclude.Include incl)
-    {
-        super(src);
-        _serFeatures = src._serFeatures;
-        _serializationInclusion = incl;
-        _filterProvider = src._filterProvider;
-    }
-
-    private SerializationConfig(SerializationConfig src, String rootName)
-    {
-        super(src, rootName);
-        _serFeatures = src._serFeatures;
-        _serializationInclusion = src._serializationInclusion;
-        _filterProvider = src._filterProvider;
-    }
-    
-    /*
-    /**********************************************************
-    /* Life-cycle, factory methods from MapperConfig
-    /**********************************************************
-     */
-
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified features enabled.
-     */
-    @Override
-    public SerializationConfig with(MapperConfig.Feature... features)
-    {
-        int newMapperFlags = _mapperFeatures;
-        for (MapperConfig.Feature f : features) {
-            newMapperFlags |= f.getMask();
-        }
-        return (newMapperFlags == _mapperFeatures) ? this
-                : new SerializationConfig(this, newMapperFlags, _serFeatures);
-    }
-    
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified features disabled.
-     */
-    @Override
-    public SerializationConfig without(MapperConfig.Feature... features)
-    {
-        int newMapperFlags = _mapperFeatures;
-        for (MapperConfig.Feature f : features) {
-             newMapperFlags &= ~f.getMask();
-        }
-        return (newMapperFlags == _mapperFeatures) ? this
-                : new SerializationConfig(this, newMapperFlags, _serFeatures);
-    }
-
-    @Override
-    public SerializationConfig withAnnotationIntrospector(AnnotationIntrospector ai) {
-        return _withBase(_base.withAnnotationIntrospector(ai));
-    }
-
-    @Override
-    public SerializationConfig withAppendedAnnotationIntrospector(AnnotationIntrospector ai) {
-        return _withBase(_base.withAppendedAnnotationIntrospector(ai));
-    }
-
-    @Override
-    public SerializationConfig withInsertedAnnotationIntrospector(AnnotationIntrospector ai) {
-        return _withBase(_base.withInsertedAnnotationIntrospector(ai));
-    }
-
-    @Override
-    public SerializationConfig withClassIntrospector(ClassIntrospector ci) {
-        return _withBase(_base.withClassIntrospector(ci));
-    }
-    
-    /**
-     * In addition to constructing instance with specified date format,
-     * will enable or disable <code>Feature.WRITE_DATES_AS_TIMESTAMPS</code>
-     * (enable if format set as null; disable if non-null)
-     */
-    @Override
-    public SerializationConfig withDateFormat(DateFormat df) {
-        SerializationConfig cfg =  new SerializationConfig(this, _base.withDateFormat(df));
-        // Also need to toggle this feature based on existence of date format:
-        if (df == null) {
-            cfg = cfg.with(Feature.WRITE_DATES_AS_TIMESTAMPS);
-        } else {
-            cfg = cfg.without(Feature.WRITE_DATES_AS_TIMESTAMPS);
-        }
-        return cfg;
-    }
-    
-    @Override
-    public SerializationConfig withHandlerInstantiator(HandlerInstantiator hi) {
-        return _withBase(_base.withHandlerInstantiator(hi));
-    }
-    
-    @Override
-    public SerializationConfig withPropertyNamingStrategy(PropertyNamingStrategy pns) {
-        return _withBase(_base.withPropertyNamingStrategy(pns));
-    }
-
-    @Override
-    public SerializationConfig withRootName(String rootName) {
-        if (rootName == null) {
-            if (_rootName == null) {
-                return this;
-            }
-        } else if (rootName.equals(_rootName)) {
-            return this;
-        }
-        return new SerializationConfig(this, rootName);
-    }
-
-    @Override
-    public SerializationConfig withSubtypeResolver(SubtypeResolver str) {
-        return (str == _subtypeResolver)? this : new SerializationConfig(this, str);
-    }
-
-    @Override
-    public SerializationConfig withTypeFactory(TypeFactory tf) {
-        return _withBase(_base.withTypeFactory(tf));
-    }
-
-    @Override
-    public SerializationConfig withTypeResolverBuilder(TypeResolverBuilder<?> trb) {
-        return _withBase(_base.withTypeResolverBuilder(trb));
-    }
-    
-    public SerializationConfig withView(Class<?> view) {
-        return (_view == view) ? this : new SerializationConfig(this, view);
-    }
-
-    @Override
-    public SerializationConfig withVisibilityChecker(VisibilityChecker<?> vc) {
-        return _withBase(_base.withVisibilityChecker(vc));
-    }
-
-    @Override
-    public SerializationConfig withVisibility(PropertyAccessor forMethod, JsonAutoDetect.Visibility visibility) {
-        return _withBase(_base.withVisibility(forMethod, visibility));
-    }
-    
-    private final SerializationConfig _withBase(BaseSettings newBase) {
-        return (_base == newBase) ? this : new SerializationConfig(this, newBase);
-    }
-    
-    /*
-    /**********************************************************
-    /* Life-cycle, SerializationConfig specific factory methods
-    /**********************************************************
-     */
-        
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified feature enabled.
-     */
-    public SerializationConfig with(Feature feature)
-    {
-        int newSerFeatures = _serFeatures | feature.getMask();
-        return (newSerFeatures == _serFeatures) ? this
-                : new SerializationConfig(this, _mapperFeatures, newSerFeatures);
-    }
-
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified features enabled.
-     */
-    public SerializationConfig with(Feature first, Feature... features)
-    {
-        int newSerFeatures = _serFeatures | first.getMask();
-        for (Feature f : features) {
-            newSerFeatures |= f.getMask();
-        }
-        return (newSerFeatures == _serFeatures) ? this
-                : new SerializationConfig(this, _mapperFeatures, newSerFeatures);
-    }
-    
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified features enabled.
-     */
-    public SerializationConfig withFeatures(Feature... features)
-    {
-        int newSerFeatures = _serFeatures;
-        for (Feature f : features) {
-            newSerFeatures |= f.getMask();
-        }
-        return (newSerFeatures == _serFeatures) ? this
-                : new SerializationConfig(this, _mapperFeatures, newSerFeatures);
-    }
-
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified feature disabled.
-     */
-    public SerializationConfig without(Feature feature)
-    {
-        int newSerFeatures = _serFeatures & ~feature.getMask();
-        return (newSerFeatures == _serFeatures) ? this
-                : new SerializationConfig(this, _mapperFeatures, newSerFeatures);
-    }
-
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified features disabled.
-     */
-    public SerializationConfig without(Feature first, Feature... features)
-    {
-        int newSerFeatures = _serFeatures & ~first.getMask();
-        for (Feature f : features) {
-            newSerFeatures &= ~f.getMask();
-        }
-        return (newSerFeatures == _serFeatures) ? this
-                : new SerializationConfig(this, _mapperFeatures, newSerFeatures);
-    }
-
-    /**
-     * Fluent factory method that will construct and return a new configuration
-     * object instance with specified features disabled.
-     */
-    public SerializationConfig withoutFeatures(Feature... features)
-    {
-        int newSerFeatures = _serFeatures;
-        for (Feature f : features) {
-            newSerFeatures &= ~f.getMask();
-        }
-        return (newSerFeatures == _serFeatures) ? this
-                : new SerializationConfig(this, _mapperFeatures, newSerFeatures);
-    }
-    
-    public SerializationConfig withFilters(FilterProvider filterProvider) {
-        return (filterProvider == _filterProvider) ? this : new SerializationConfig(this, filterProvider);
-    }
-
-    public SerializationConfig withSerializationInclusion(JsonInclude.Include incl) {
-        return (_serializationInclusion == incl) ? this:  new SerializationConfig(this, incl);
-    }
-    
-    /*
-    /**********************************************************
-    /* MapperConfig implementation/overrides
-    /**********************************************************
-     */
-    
-    @Override
-    public boolean useRootWrapping()
-    {
-        if (_rootName != null) { // empty String disables wrapping; non-empty enables
-            return (_rootName.length() > 0);
-        }
-        return isEnabled(SerializationConfig.Feature.WRAP_ROOT_VALUE);
-    }
-    
-    @Override
-    public AnnotationIntrospector getAnnotationIntrospector()
-    {
-        /* 29-Jul-2009, tatu: it's now possible to disable use of
-         *   annotations; can be done using "no-op" introspector
-         */
-        if (isEnabled(MapperConfig.Feature.USE_ANNOTATIONS)) {
-            return super.getAnnotationIntrospector();
-        }
-        return AnnotationIntrospector.nopInstance();
-    }
-
-    /**
-     * Accessor for getting bean description that only contains class
-     * annotations: useful if no getter/setter/creator information is needed.
-     */
-    @Override
-    public BeanDescription introspectClassAnnotations(JavaType type) {
-        return getClassIntrospector().forClassAnnotations(this, type, this);
-    }
-
-    /**
-     * Accessor for getting bean description that only contains immediate class
-     * annotations: ones from the class, and its direct mix-in, if any, but
-     * not from super types.
-     */
-    @Override
-    public BeanDescription introspectDirectClassAnnotations(JavaType type) {
-        return getClassIntrospector().forDirectClassAnnotations(this, type, this);
-    }
-    
-    @Override
-    public VisibilityChecker<?> getDefaultVisibilityChecker()
-    {
-        VisibilityChecker<?> vchecker = super.getDefaultVisibilityChecker();
-        if (!isEnabled(MapperConfig.Feature.AUTO_DETECT_GETTERS)) {
-            vchecker = vchecker.withGetterVisibility(Visibility.NONE);
-        }
-        // then global overrides (disabling)
-        if (!isEnabled(MapperConfig.Feature.AUTO_DETECT_IS_GETTERS)) {
-            vchecker = vchecker.withIsGetterVisibility(Visibility.NONE);
-        }
-        if (!isEnabled(MapperConfig.Feature.AUTO_DETECT_FIELDS)) {
-            vchecker = vchecker.withFieldVisibility(Visibility.NONE);
-        }
-        return vchecker;
-    }
-    
-    /*
-    /**********************************************************
-    /* Configuration: other
-    /**********************************************************
-     */
-
-    public final boolean isEnabled(SerializationConfig.Feature f) {
-        return (_serFeatures & f.getMask()) != 0;
-    }
-    
-    public final int getSerializationFeatures() {
-        return _serFeatures;
-    }
-    
-    public JsonInclude.Include getSerializationInclusion()
-    {
-        if (_serializationInclusion != null) {
-            return _serializationInclusion;
-        }
-        return JsonInclude.Include.ALWAYS;
-    }
-    
-    /**
-     * Method for getting provider used for locating filters given
-     * id (which is usually provided with filter annotations).
-     * Will be null if no provided was set for {@link ObjectWriter}
-     * (or if serialization directly called from {@link ObjectMapper})
-     */
-    public FilterProvider getFilterProvider() {
-        return _filterProvider;
-    }
-
-    /*
-    /**********************************************************
-    /* Introspection methods
-    /**********************************************************
-     */
-
-    /**
-     * Method that will introspect full bean properties for the purpose
-     * of building a bean serializer
-     */
-    @SuppressWarnings("unchecked")
-    public <T extends BeanDescription> T introspect(JavaType type) {
-        return (T) getClassIntrospector().forSerialization(this, type, this);
-    }
-    
-    /*
-    /**********************************************************
-    /* Debug support
-    /**********************************************************
-     */
-    
-    @Override public String toString()
-    {
-        return "[SerializationConfig: flags=0x"+Integer.toHexString(_serFeatures)+"]";
-    }
-}
diff --git a/src/main/java/com/fasterxml/jackson/databind/SerializationFeature.java b/src/main/java/com/fasterxml/jackson/databind/SerializationFeature.java
new file mode 100644
index 0000000..171bf94
--- /dev/null
+++ b/src/main/java/com/fasterxml/jackson/databind/SerializationFeature.java
@@ -0,0 +1,248 @@
+package com.fasterxml.jackson.databind;
+
+import com.fasterxml.jackson.databind.cfg.ConfigFeature;
+
+/**
+ * Enumeration that defines simple on/off features that affect
+ * the way Java objects are serialized.
+ *<p>
+ * Note that features can be set both through
+ * {@link ObjectMapper} (as sort of defaults) and through
+ * {@link ObjectWriter}.
+ * In first case these defaults must follow "config-then-use" patterns
+ * (i.e. defined once, not changed afterwards); all per-call
+ * changes must be done using {@link ObjectWriter}.
+ */
+public enum SerializationFeature implements ConfigFeature
+{
+    /*
+    /******************************************************
+    /* Generic output features
+    /******************************************************
+     */
+    
+    /**
+     * SerializationFeature that can be enabled to make root value (usually JSON
+     * Object but can be any type) wrapped within a single property
+     * JSON object, where key as the "root name", as determined by
+     * annotation introspector (esp. for JAXB that uses
+     * <code>@XmlRootElement.name</code>) or fallback (non-qualified
+     * class name).
+     * SerializationFeature is mostly intended for JAXB compatibility.
+     *<p>
+     * SerializationFeature is enabled by default.
+     */
+    WRAP_ROOT_VALUE(false),
+
+    /**
+     * SerializationFeature that allows enabling (or disabling) indentation
+     * for the underlying generator, using the default pretty
+     * printer (see
+     * {@link com.fasterxml.jackson.core.JsonGenerator#useDefaultPrettyPrinter}
+     * for details).
+     *<p>
+     * Note that this only affects cases where
+     * {@link com.fasterxml.jackson.core.JsonGenerator}
+     * is constructed implicitly by ObjectMapper: if explicit
+     * generator is passed, its configuration is not changed.
+     *<p>
+     * Also note that if you want to configure details of indentation,
+     * you need to directly configure the generator: there is a
+     * method to use any <code>PrettyPrinter</code> instance.
+     * This feature will only allow using the default implementation.
+     *<p>
+     * SerializationFeature is enabled by default.
+     */
+    INDENT_OUTPUT(false),
+    
+    /*
+    /******************************************************
+    /*  Error handling features
+    /******************************************************
+     */
+    
+    /**
+     * SerializationFeature that determines what happens when no accessors are
+     * found for a type (and there are no annotations to indicate
+     * it is meant to be serialized). If enabled (default), an
+     * exception is thrown to indicate these as non-serializable
+     * types; if disabled, they are serialized as empty Objects,
+     * i.e. without any properties.
+     *<p>
+     * Note that empty types that this feature has only effect on
+     * those "empty" beans that do not have any recognized annotations
+     * (like <code>@JsonSerialize</code>): ones that do have annotations
+     * do not result in an exception being thrown.
+     *<p>
+     * SerializationFeature is enabled by default.
+     */
+    FAIL_ON_EMPTY_BEANS(true),
+
+    /**
+     * SerializationFeature that determines whether Jackson code should catch
+     * and wrap {@link Exception}s (but never {@link Error}s!)
+     * to add additional information about
+     * location (within input) of problem or not. If enabled,
+     * most exceptions will be caught and re-thrown (exception
+     * specifically being that {@link java.io.IOException}s may be passed
+     * as is, since they are declared as throwable); this can be
+     * convenient both in that all exceptions will be checked and
+     * declared, and so there is more contextual information.
+     * However, sometimes calling application may just want "raw"
+     * unchecked exceptions passed as is.
+     *<p>
+     *<p>
+     * SerializationFeature is enabled by default.
+     */
+    WRAP_EXCEPTIONS(true),
+
+    /*
+    /******************************************************
+    /* Output life cycle features
+    /******************************************************
+     */
+    
+     /**
+      * SerializationFeature that determines whether <code>close</code> method of
+      * serialized <b>root level</b> objects (ones for which <code>ObjectMapper</code>'s
+      * writeValue() (or equivalent) method is called)
+      * that implement {@link java.io.Closeable} 
+      * is called after serialization or not. If enabled, <b>close()</b> will
+      * be called after serialization completes (whether succesfully, or
+      * due to an error manifested by an exception being thrown). You can
+      * think of this as sort of "finally" processing.
+      *<p>
+      * NOTE: only affects behavior with <b>root</b> objects, and not other
+      * objects reachable from the root object. Put another way, only one
+      * call will be made for each 'writeValue' call.
+     *<p>
+     * SerializationFeature is disabled by default.
+      */
+    CLOSE_CLOSEABLE(false),
+
+    /**
+     * SerializationFeature that determines whether <code>JsonGenerator.flush()</code> is
+     * called after <code>writeValue()</code> method <b>that takes JsonGenerator
+     * as an argument</b> completes (i.e. does NOT affect methods
+     * that use other destinations); same for methods in {@link ObjectWriter}.
+     * This usually makes sense; but there are cases where flushing
+     * should not be forced: for example when underlying stream is
+     * compressing and flush() causes compression state to be flushed
+     * (which occurs with some compression codecs).
+     *<p>
+     * SerializationFeature is enabled by default.
+     */
+    FLUSH_AFTER_WRITE_VALUE(true),
+     
+    /*
+    /******************************************************
+    /* Data type - specific serialization configuration
+    /******************************************************
+     */
+
+    /**
+     * SerializationFeature that determines whether {@link java.util.Date} values
+     * (and Date-based things like {@link java.util.Calendar}s) are to be
+     * serialized as numeric timestamps (true; the default),
+     * or as something else (usually textual representation).
+     * If textual representation is used, the actual format is
+     * one returned by a call to {@link #getDateFormat}.
+     *<p>
+     * Note: whether this feature affects handling of other date-related
+     * types depend on handlers of those types, although ideally they
+     * should use this feature
+     *<p>
+     * Note: whether {@link java.util.Map} keys are serialized as Strings
+     * or not is controlled using {@link #WRITE_DATE_KEYS_AS_TIMESTAMPS}.
+     *<p>
+     * SerializationFeature is enabled by default.
+     */
+    WRITE_DATES_AS_TIMESTAMPS(true),
+
+    /**
+     * SerializationFeature that determines whether {@link java.util.Date}s
+     * (and sub-types) used as {@link java.util.Map} keys are serialized
+     * as timestamps or not (if not, will be serialized as textual
+     * values).
+     *<p>
+     * Default value is 'false', meaning that Date-valued Map keys are serialized
+     * as textual (ISO-8601) values.
+     *<p>
+     * SerializationFeature is disabled by default.
+     */
+    WRITE_DATE_KEYS_AS_TIMESTAMPS(false),
+
+    /**
+     * SerializationFeature that determines how type <code>char[]</code> is serialized:
+     * when enabled, will be serialized as an explict JSON array (with
+     * single-character Strings as values); when disabled, defaults to
+     * serializing them as Strings (which is more compact).
+     *<p>
+     * SerializationFeature is disabled by default.
+     */
+    WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS(false),
+
+    /**
+     * SerializationFeature that determines standard serialization mechanism used for
+     * Enum values: if enabled, return value of <code>Enum.toString()</code>
+     * is used; if disabled, return value of <code>Enum.name()</code> is used.
+     *<p>
+     * Note: this feature should usually have same value
+     * as {@link DeserializationConfig.DeserializationFeature#READ_ENUMS_USING_TO_STRING}.
+     *<p>
+     * SerializationFeature is disabled by default.
+     */
+    WRITE_ENUMS_USING_TO_STRING(false),
+
+    /**
+     * SerializationFeature that determines whethere Java Enum values are serialized
+     * as numbers (true), or textual values (false). If textual values are
+     * used, other settings are also considered.
+     * If this feature is enabled,
+     *  return value of <code>Enum.ordinal()</code>
+     * (an integer) will be used as the serialization.
+     *<p>
+     * Note that this feature has precedence over {@link #WRITE_ENUMS_USING_TO_STRING},
+     * which is only considered if this feature is set to false.
+     *<p>
+     * SerializationFeature is disabled by default.
+     */
+    WRITE_ENUMS_USING_INDEX(false),
+    
+    /**
+     * SerializationFeature that determines whether Map entries with null values are
+     * to be serialized (true) or not (false).
+     *<p>
+     * For further details, check out [JACKSON-314]
+     *<p>
+     * SerializationFeature is enabled by default.
+     */
+    WRITE_NULL_MAP_VALUES(true),
+
+    /**
+     * SerializationFeature that determines whether Container properties (POJO properties
+     * with declared value of Collection or array; i.e. things that produce JSON
+     * arrays) that are empty (have no elements)
+     * will be serialized as empty JSON arrays (true), or suppressed from output (false).
+     *<p>
+     * Note that this does not change behavior of {@link java.util.Map}s, or
+     * "Collection-like" types.
+     *<p>
+     * SerializationFeature is enabled by default.
+     */
+    WRITE_EMPTY_JSON_ARRAYS(true)
+    
+        ;
+
+    private final boolean _defaultState;
+    
+    private SerializationFeature(boolean defaultState) {
+        _defaultState = defaultState;
+    }
+    
+    @Override
+    public boolean enabledByDefault() { return _defaultState; }
+
+    @Override
+    public int getMask() { return (1 << ordinal()); }
+}
\ No newline at end of file
diff --git a/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java b/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java
index 985a97b..777f4fc 100644
--- a/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java
+++ b/src/main/java/com/fasterxml/jackson/databind/SerializerProvider.java
@@ -8,7 +8,8 @@
 import com.fasterxml.jackson.core.*;
 
 import com.fasterxml.jackson.databind.annotation.NoClass;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.HandlerInstantiator;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.introspect.Annotated;
 import com.fasterxml.jackson.databind.jsonschema.JsonSchema;
 import com.fasterxml.jackson.databind.jsonschema.SchemaAware;
@@ -295,7 +296,7 @@
             String rootName = _config.getRootName();
             if (rootName == null) { // not explicitly specified
                 // [JACKSON-163]
-                wrap = _config.isEnabled(SerializationConfig.Feature.WRAP_ROOT_VALUE);
+                wrap = _config.isEnabled(SerializationFeature.WRAP_ROOT_VALUE);
                 if (wrap) {
                     jgen.writeStartObject();
                     jgen.writeFieldName(_rootNames.findRootName(value.getClass(), _config));
@@ -358,7 +359,7 @@
             // root value, not reached via property:
             ser = findTypedValueSerializer(rootType, true, null);
             // [JACKSON-163]
-            wrap = _config.isEnabled(SerializationConfig.Feature.WRAP_ROOT_VALUE);
+            wrap = _config.isEnabled(SerializationFeature.WRAP_ROOT_VALUE);
             if (wrap) {
                 jgen.writeStartObject();
                 jgen.writeFieldName(_rootNames.findRootName(rootType, _config));
@@ -437,7 +438,7 @@
      *  getConfig().isEnabled(feature);
      *</pre>
      */
-    public final boolean isEnabled(MapperConfig.Feature feature) {
+    public final boolean isEnabled(MapperFeature feature) {
         return _config.isEnabled(feature);
     }
 
@@ -449,7 +450,7 @@
      *  getConfig().isEnabled(feature);
      *</pre>
      */
-    public final boolean isEnabled(SerializationConfig.Feature feature) {
+    public final boolean isEnabled(SerializationFeature feature) {
         return _config.isEnabled(feature);
     }
 
@@ -922,7 +923,7 @@
         throws IOException, JsonProcessingException
     {
         // [JACKSON-87]: Support both numeric timestamps and textual
-        if (isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS)) {
+        if (isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)) {
             jgen.writeNumber(timestamp);
         } else {
             if (_dateFormat == null) {
@@ -944,7 +945,7 @@
         throws IOException, JsonProcessingException
     {
         // [JACKSON-87]: Support both numeric timestamps and textual
-        if (isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS)) {
+        if (isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)) {
             jgen.writeNumber(date.getTime());
         } else {
             if (_dateFormat == null) {
@@ -958,13 +959,13 @@
 
     /**
      * Method that will handle serialization of Dates used as {@link java.util.Map} keys,
-     * based on {@link SerializationConfig.Feature#WRITE_DATE_KEYS_AS_TIMESTAMPS}
+     * based on {@link SerializationFeature#WRITE_DATE_KEYS_AS_TIMESTAMPS}
      * value (and if using textual representation, configured date format)
      */
     public void defaultSerializeDateKey(long timestamp, JsonGenerator jgen)
         throws IOException, JsonProcessingException
     {
-        if (isEnabled(SerializationConfig.Feature.WRITE_DATE_KEYS_AS_TIMESTAMPS)) {
+        if (isEnabled(SerializationFeature.WRITE_DATE_KEYS_AS_TIMESTAMPS)) {
             jgen.writeFieldName(String.valueOf(timestamp));
         } else {
             if (_dateFormat == null) {
@@ -978,13 +979,13 @@
 
     /**
      * Method that will handle serialization of Dates used as {@link java.util.Map} keys,
-     * based on {@link SerializationConfig.Feature#WRITE_DATE_KEYS_AS_TIMESTAMPS}
+     * based on {@link SerializationFeature#WRITE_DATE_KEYS_AS_TIMESTAMPS}
      * value (and if using textual representation, configured date format)
      */
     public void defaultSerializeDateKey(Date date, JsonGenerator jgen)
         throws IOException, JsonProcessingException
     {
-        if (isEnabled(SerializationConfig.Feature.WRITE_DATE_KEYS_AS_TIMESTAMPS)) {
+        if (isEnabled(SerializationFeature.WRITE_DATE_KEYS_AS_TIMESTAMPS)) {
             jgen.writeFieldName(String.valueOf(date.getTime()));
         } else {
             if (_dateFormat == null) {
diff --git a/src/main/java/com/fasterxml/jackson/databind/cfg/BaseSettings.java b/src/main/java/com/fasterxml/jackson/databind/cfg/BaseSettings.java
index f43724e..9325251 100644
--- a/src/main/java/com/fasterxml/jackson/databind/cfg/BaseSettings.java
+++ b/src/main/java/com/fasterxml/jackson/databind/cfg/BaseSettings.java
@@ -5,7 +5,6 @@
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
 import com.fasterxml.jackson.annotation.PropertyAccessor;
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.PropertyNamingStrategy;
 import com.fasterxml.jackson.databind.introspect.ClassIntrospector;
 import com.fasterxml.jackson.databind.introspect.VisibilityChecker;
 import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder;
diff --git a/src/main/java/com/fasterxml/jackson/databind/cfg/ConfigFeature.java b/src/main/java/com/fasterxml/jackson/databind/cfg/ConfigFeature.java
index 010fcfb..d38d321 100644
--- a/src/main/java/com/fasterxml/jackson/databind/cfg/ConfigFeature.java
+++ b/src/main/java/com/fasterxml/jackson/databind/cfg/ConfigFeature.java
@@ -1,7 +1,7 @@
 package com.fasterxml.jackson.databind.cfg;
 
 /**
- * Interface that actual Feature enumerations used by
+ * Interface that actual SerializationFeature enumerations used by
  * {@link MapperConfig} implementations must implement.
  * Necessary since enums can not be extended using normal
  * inheritance, but can implement interfaces
diff --git a/src/main/java/com/fasterxml/jackson/databind/DatabindVersion.java b/src/main/java/com/fasterxml/jackson/databind/cfg/DatabindVersion.java
similarity index 89%
rename from src/main/java/com/fasterxml/jackson/databind/DatabindVersion.java
rename to src/main/java/com/fasterxml/jackson/databind/cfg/DatabindVersion.java
index 2b67614..0b565d4 100644
--- a/src/main/java/com/fasterxml/jackson/databind/DatabindVersion.java
+++ b/src/main/java/com/fasterxml/jackson/databind/cfg/DatabindVersion.java
@@ -1,4 +1,4 @@
-package com.fasterxml.jackson.databind;
+package com.fasterxml.jackson.databind.cfg;
 
 import com.fasterxml.jackson.core.util.VersionUtil;
 
diff --git a/src/main/java/com/fasterxml/jackson/databind/cfg/DeserializationConfig.java b/src/main/java/com/fasterxml/jackson/databind/cfg/DeserializationConfig.java
new file mode 100644
index 0000000..a490675
--- /dev/null
+++ b/src/main/java/com/fasterxml/jackson/databind/cfg/DeserializationConfig.java
@@ -0,0 +1,497 @@
+package com.fasterxml.jackson.databind.cfg;
+
+import java.text.DateFormat;
+import java.util.*;
+
+import com.fasterxml.jackson.annotation.*;
+import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
+import com.fasterxml.jackson.core.*;
+import com.fasterxml.jackson.databind.AnnotationIntrospector;
+import com.fasterxml.jackson.databind.BeanDescription;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.MapperFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.deser.DeserializationProblemHandler;
+import com.fasterxml.jackson.databind.introspect.ClassIntrospector;
+import com.fasterxml.jackson.databind.introspect.NopAnnotationIntrospector;
+import com.fasterxml.jackson.databind.introspect.VisibilityChecker;
+import com.fasterxml.jackson.databind.jsontype.SubtypeResolver;
+import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder;
+import com.fasterxml.jackson.databind.node.JsonNodeFactory;
+import com.fasterxml.jackson.databind.type.ClassKey;
+import com.fasterxml.jackson.databind.type.TypeFactory;
+import com.fasterxml.jackson.databind.util.LinkedNode;
+
+/**
+ * Object that contains baseline configuration for deserialization
+ * process. An instance is owned by {@link ObjectMapper}, which
+ * passes an immutable instance to be used for deserialization process.
+ *<p>
+ * Note that instances are considered immutable and as such no copies
+ * should need to be created (there are some implementation details
+ * with respect to mix-in annotations; where this is guaranteed as
+ * long as caller follow "copy-then-use" pattern)
+ */
+public final class DeserializationConfig
+    extends MapperConfigBase<DeserializationFeature, DeserializationConfig>
+{
+    /**
+     * Set of features enabled; actual type (kind of features)
+     * depends on sub-classes.
+     */
+    protected final int _deserFeatures;
+
+    /**
+     * Linked list that contains all registered problem handlers.
+     * Implementation as front-added linked list allows for sharing
+     * of the list (tail) without copying the list.
+     */
+    protected final LinkedNode<DeserializationProblemHandler> _problemHandlers;
+    
+    /**
+     * Factory used for constructing {@link com.fasterxml.jackson.core.JsonNode} instances.
+     */
+    protected final JsonNodeFactory _nodeFactory;
+    
+    /*
+    /**********************************************************
+    /* Life-cycle, constructors
+    /**********************************************************
+     */
+
+    /**
+     * Constructor used by ObjectMapper to create default configuration object instance.
+     */
+    public DeserializationConfig(BaseSettings base,
+            SubtypeResolver str, Map<ClassKey,Class<?>> mixins)
+    {
+        super(base, str, mixins);
+        _deserFeatures = collectFeatureDefaults(DeserializationFeature.class);
+        _nodeFactory = JsonNodeFactory.instance;
+        _problemHandlers = null;
+    }
+
+    /**
+     * Copy constructor used to create a non-shared instance with given mix-in
+     * annotation definitions and subtype resolver.
+     */
+    private DeserializationConfig(DeserializationConfig src, SubtypeResolver str)
+    {
+        super(src, str);
+        _deserFeatures = src._deserFeatures;
+        _nodeFactory = src._nodeFactory;
+        _problemHandlers = src._problemHandlers;
+    }
+
+    private DeserializationConfig(DeserializationConfig src,
+            int mapperFeatures, int deserFeatures)
+    {
+        super(src, mapperFeatures);
+        _deserFeatures = deserFeatures;
+        _nodeFactory = src._nodeFactory;
+        _problemHandlers = src._problemHandlers;
+    }
+    
+    private DeserializationConfig(DeserializationConfig src, BaseSettings base)
+    {
+        super(src, base);
+        _deserFeatures = src._deserFeatures;
+        _nodeFactory = src._nodeFactory;
+        _problemHandlers = src._problemHandlers;
+    }
+    
+    private DeserializationConfig(DeserializationConfig src, JsonNodeFactory f)
+    {
+        super(src);
+        _deserFeatures = src._deserFeatures;
+        _problemHandlers = src._problemHandlers;
+        _nodeFactory = f;
+    }
+
+    private DeserializationConfig(DeserializationConfig src,
+            LinkedNode<DeserializationProblemHandler> problemHandlers)
+    {
+        super(src);
+        _deserFeatures = src._deserFeatures;
+        _problemHandlers = problemHandlers;
+        _nodeFactory = src._nodeFactory;
+    }
+
+    private DeserializationConfig(DeserializationConfig src, String rootName)
+    {
+        super(src, rootName);
+        _deserFeatures = src._deserFeatures;
+        _problemHandlers = src._problemHandlers;
+        _nodeFactory = src._nodeFactory;
+    }
+
+    private DeserializationConfig(DeserializationConfig src, Class<?> view)
+    {
+        super(src, view);
+        _deserFeatures = src._deserFeatures;
+        _problemHandlers = src._problemHandlers;
+        _nodeFactory = src._nodeFactory;
+    }
+    
+    /*
+    /**********************************************************
+    /* Life-cycle, factory methods from MapperConfig
+    /**********************************************************
+     */
+
+    @Override
+    public DeserializationConfig with(MapperFeature... features)
+    {
+        int newMapperFlags = _mapperFeatures;
+        for (MapperFeature f : features) {
+            newMapperFlags |= f.getMask();
+        }
+        return (newMapperFlags == _mapperFeatures) ? this :
+            new DeserializationConfig(this, newMapperFlags, _deserFeatures);
+    }
+
+    @Override
+    public DeserializationConfig without(MapperFeature... features)
+    {
+        int newMapperFlags = _mapperFeatures;
+        for (MapperFeature f : features) {
+             newMapperFlags &= ~f.getMask();
+        }
+        return (newMapperFlags == _mapperFeatures) ? this :
+            new DeserializationConfig(this, newMapperFlags, _deserFeatures);
+    }
+    
+    @Override
+    public DeserializationConfig withClassIntrospector(ClassIntrospector ci) {
+        return _withBase(_base.withClassIntrospector(ci));
+    }
+
+    @Override
+    public DeserializationConfig withAnnotationIntrospector(AnnotationIntrospector ai) {
+        return _withBase(_base.withAnnotationIntrospector(ai));
+    }
+
+    @Override
+    public DeserializationConfig withVisibilityChecker(VisibilityChecker<?> vc) {
+        return _withBase(_base.withVisibilityChecker(vc));
+    }
+
+    @Override
+    public DeserializationConfig withVisibility(PropertyAccessor forMethod, JsonAutoDetect.Visibility visibility) {
+        return _withBase( _base.withVisibility(forMethod, visibility));
+    }
+    
+    @Override
+    public DeserializationConfig withTypeResolverBuilder(TypeResolverBuilder<?> trb) {
+        return _withBase(_base.withTypeResolverBuilder(trb));
+    }
+
+    @Override
+    public DeserializationConfig withSubtypeResolver(SubtypeResolver str) {
+        return (_subtypeResolver == str) ? this : new DeserializationConfig(this, str);
+    }
+    
+    @Override
+    public DeserializationConfig withPropertyNamingStrategy(PropertyNamingStrategy pns) {
+        return _withBase(_base.withPropertyNamingStrategy(pns));
+    }
+
+    @Override
+    public DeserializationConfig withRootName(String rootName) {
+        if (rootName == null) {
+            if (_rootName == null) {
+                return this;
+            }
+        } else if (rootName.equals(_rootName)) {
+            return this;
+        }
+        return new DeserializationConfig(this, rootName);
+    }
+    
+    @Override
+    public DeserializationConfig withTypeFactory(TypeFactory tf) {
+        return _withBase( _base.withTypeFactory(tf));
+    }
+
+    @Override
+    public DeserializationConfig withDateFormat(DateFormat df) {
+        return _withBase(_base.withDateFormat(df));
+    }
+    
+    @Override
+    public DeserializationConfig withHandlerInstantiator(HandlerInstantiator hi) {
+        return _withBase(_base.withHandlerInstantiator(hi));
+    }
+
+    @Override
+    public DeserializationConfig withInsertedAnnotationIntrospector(AnnotationIntrospector ai) {
+        return _withBase(_base.withInsertedAnnotationIntrospector(ai));
+    }
+
+    @Override
+    public DeserializationConfig withAppendedAnnotationIntrospector(AnnotationIntrospector ai) {
+        return _withBase(_base.withAppendedAnnotationIntrospector(ai));
+    }
+
+    @Override
+    public DeserializationConfig withView(Class<?> view) {
+        return (_view == view) ? this : new DeserializationConfig(this, view);
+    }
+    
+    private final DeserializationConfig _withBase(BaseSettings newBase) {
+        return (_base == newBase) ? this : new DeserializationConfig(this, newBase);
+    }
+    
+    /*
+    /**********************************************************
+    /* Life-cycle, deserialization-specific factory methods
+    /**********************************************************
+     */
+
+    /**
+     * Fluent factory method that will construct a new instance with
+     * specified {@link JsonNodeFactory}
+     */
+    public DeserializationConfig withNodeFactory(JsonNodeFactory f) {
+        if (_nodeFactory == f) {
+            return this;
+        }
+        return new DeserializationConfig(this, f);
+    }
+
+    /**
+     * Method that can be used to add a handler that can (try to)
+     * resolve non-fatal deserialization problems.
+     */
+    public DeserializationConfig withHandler(DeserializationProblemHandler h)
+    {
+        // Sanity check: let's prevent adding same handler multiple times
+        if (LinkedNode.contains(_problemHandlers, h)) {
+            return this;
+        }
+        return new DeserializationConfig(this,
+                new LinkedNode<DeserializationProblemHandler>(h, _problemHandlers));
+    }
+
+    /**
+     * Method for removing all configured problem handlers; usually done to replace
+     * existing handler(s) with different one(s)
+     */
+    public DeserializationConfig withNoProblemHandlers() {
+        if (_problemHandlers == null) {
+            return this;
+        }
+        return new DeserializationConfig(this,
+                (LinkedNode<DeserializationProblemHandler>) null);
+    }
+
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified features enabled.
+     */
+    public DeserializationConfig with(DeserializationFeature feature)
+    {
+        int newDeserFeatures = (_deserFeatures | feature.getMask());
+        return (newDeserFeatures == _deserFeatures) ? this :
+            new DeserializationConfig(this, _mapperFeatures, newDeserFeatures);
+    }
+
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified features enabled.
+     */
+    public DeserializationConfig with(DeserializationFeature first,
+            DeserializationFeature... features)
+    {
+        int newDeserFeatures = _deserFeatures | first.getMask();
+        for (DeserializationFeature f : features) {
+            newDeserFeatures |= f.getMask();
+        }
+        return (newDeserFeatures == _deserFeatures) ? this :
+            new DeserializationConfig(this, _mapperFeatures, newDeserFeatures);
+    }
+
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified features enabled.
+     */
+    public DeserializationConfig withFeatures(DeserializationFeature... features)
+    {
+        int newDeserFeatures = _deserFeatures;
+        for (DeserializationFeature f : features) {
+            newDeserFeatures |= f.getMask();
+        }
+        return (newDeserFeatures == _deserFeatures) ? this :
+            new DeserializationConfig(this, _mapperFeatures, newDeserFeatures);
+    }
+    
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified feature disabled.
+     */
+    public DeserializationConfig without(DeserializationFeature feature)
+    {
+        int newDeserFeatures = _deserFeatures & ~feature.getMask();
+        return (newDeserFeatures == _deserFeatures) ? this :
+            new DeserializationConfig(this, _mapperFeatures, newDeserFeatures);
+    }
+
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified features disabled.
+     */
+    public DeserializationConfig without(DeserializationFeature first,
+            DeserializationFeature... features)
+    {
+        int newDeserFeatures = _deserFeatures & ~first.getMask();
+        for (DeserializationFeature f : features) {
+            newDeserFeatures &= ~f.getMask();
+        }
+        return (newDeserFeatures == _deserFeatures) ? this :
+            new DeserializationConfig(this, _mapperFeatures, newDeserFeatures);
+    }
+
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified features disabled.
+     */
+    public DeserializationConfig withoutFeatures(DeserializationFeature... features)
+    {
+        int newDeserFeatures = _deserFeatures;
+        for (DeserializationFeature f : features) {
+            newDeserFeatures &= ~f.getMask();
+        }
+        return (newDeserFeatures == _deserFeatures) ? this :
+            new DeserializationConfig(this, _mapperFeatures, newDeserFeatures);
+    }
+    
+    /*
+    /**********************************************************
+    /* MapperConfig implementation
+    /**********************************************************
+     */
+    
+    /**
+     * Method for getting {@link AnnotationIntrospector} configured
+     * to introspect annotation values used for configuration.
+     */
+    @Override
+    public AnnotationIntrospector getAnnotationIntrospector()
+    {
+        /* 29-Jul-2009, tatu: it's now possible to disable use of
+         *   annotations; can be done using "no-op" introspector
+         */
+        if (isEnabled(MapperFeature.USE_ANNOTATIONS)) {
+            return super.getAnnotationIntrospector();
+        }
+        return NopAnnotationIntrospector.instance;
+    }
+
+    @Override
+    public boolean useRootWrapping()
+    {
+        if (_rootName != null) { // empty String disables wrapping; non-empty enables
+            return (_rootName.length() > 0);
+        }
+        return isEnabled(DeserializationFeature.UNWRAP_ROOT_VALUE);
+    }
+    
+    /**
+     * Accessor for getting bean description that only contains class
+     * annotations: useful if no getter/setter/creator information is needed.
+     */
+    @Override
+    public BeanDescription introspectClassAnnotations(JavaType type) {
+        return getClassIntrospector().forClassAnnotations(this, type, this);
+    }
+
+    /**
+     * Accessor for getting bean description that only contains immediate class
+     * annotations: ones from the class, and its direct mix-in, if any, but
+     * not from super types.
+     */
+    @Override
+    public BeanDescription introspectDirectClassAnnotations(JavaType type) {
+        return getClassIntrospector().forDirectClassAnnotations(this, type, this);
+    }
+
+    @Override
+    public VisibilityChecker<?> getDefaultVisibilityChecker()
+    {
+        VisibilityChecker<?> vchecker = super.getDefaultVisibilityChecker();
+        if (!isEnabled(MapperFeature.AUTO_DETECT_SETTERS)) {
+            vchecker = vchecker.withSetterVisibility(Visibility.NONE);
+        }
+        if (!isEnabled(MapperFeature.AUTO_DETECT_CREATORS)) {
+            vchecker = vchecker.withCreatorVisibility(Visibility.NONE);
+        }
+        if (!isEnabled(MapperFeature.AUTO_DETECT_FIELDS)) {
+            vchecker = vchecker.withFieldVisibility(Visibility.NONE);
+        }
+        return vchecker;
+    }
+
+    public final boolean isEnabled(DeserializationFeature f) {
+        return (_deserFeatures & f.getMask()) != 0;
+    }
+
+    /*
+    /**********************************************************
+    /* Other configuration
+    /**********************************************************
+     */
+
+    public final int getDeserializationFeatures() {
+        return _deserFeatures;
+    }
+    
+    /**
+     * Method for getting head of the problem handler chain. May be null,
+     * if no handlers have been added.
+     */
+    public LinkedNode<DeserializationProblemHandler> getProblemHandlers() {
+        return _problemHandlers;
+    }
+    
+    /**
+     * Method called during deserialization if Base64 encoded content
+     * needs to be decoded. Default version just returns default Jackson
+     * uses, which is modified-mime which does not add linefeeds (because
+     * those would have to be escaped in JSON strings).
+     */
+    public Base64Variant getBase64Variant() {
+        return Base64Variants.getDefaultVariant();
+    }
+
+    public final JsonNodeFactory getNodeFactory() {
+        return _nodeFactory;
+    }
+    
+    /*
+    /**********************************************************
+    /* Introspection methods
+    /**********************************************************
+     */
+
+    /**
+     * Method that will introspect full bean properties for the purpose
+     * of building a bean deserializer
+     *
+     * @param type Type of class to be introspected
+     */
+    @SuppressWarnings("unchecked")
+    public <T extends BeanDescription> T introspect(JavaType type) {
+        return (T) getClassIntrospector().forDeserialization(this, type, this);
+    }
+
+    /**
+     * Method that will introspect subset of bean properties needed to
+     * construct bean instance.
+     */
+    @SuppressWarnings("unchecked")
+    public <T extends BeanDescription> T introspectForCreation(JavaType type) {
+        return (T) getClassIntrospector().forCreation(this, type, this);
+    }
+}
diff --git a/src/main/java/com/fasterxml/jackson/databind/HandlerInstantiator.java b/src/main/java/com/fasterxml/jackson/databind/cfg/HandlerInstantiator.java
similarity index 95%
rename from src/main/java/com/fasterxml/jackson/databind/HandlerInstantiator.java
rename to src/main/java/com/fasterxml/jackson/databind/cfg/HandlerInstantiator.java
index c38dc3f..dc4b4d6 100644
--- a/src/main/java/com/fasterxml/jackson/databind/HandlerInstantiator.java
+++ b/src/main/java/com/fasterxml/jackson/databind/cfg/HandlerInstantiator.java
@@ -1,6 +1,8 @@
-package com.fasterxml.jackson.databind;
+package com.fasterxml.jackson.databind.cfg;
 
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.KeyDeserializer;
 import com.fasterxml.jackson.databind.deser.ValueInstantiator;
 import com.fasterxml.jackson.databind.introspect.Annotated;
 import com.fasterxml.jackson.databind.jsontype.TypeIdResolver;
diff --git a/src/main/java/com/fasterxml/jackson/databind/cfg/MapperConfig.java b/src/main/java/com/fasterxml/jackson/databind/cfg/MapperConfig.java
index cae2cc2..c951716 100644
--- a/src/main/java/com/fasterxml/jackson/databind/cfg/MapperConfig.java
+++ b/src/main/java/com/fasterxml/jackson/databind/cfg/MapperConfig.java
@@ -5,7 +5,6 @@
 import com.fasterxml.jackson.annotation.*;
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.introspect.Annotated;
 import com.fasterxml.jackson.databind.introspect.ClassIntrospector;
 import com.fasterxml.jackson.databind.introspect.VisibilityChecker;
@@ -22,7 +21,7 @@
  * accessors to mode-independent configuration settings
  * and such.
  * In addition, shared features are defined
- * in {@link MapperConfig.Feature}
+ * in {@link MapperFeature}
  *<p>
  * Small part of implementation is included here by aggregating
  * {@link BaseSettings} instance that contains configuration
@@ -32,246 +31,6 @@
     implements ClassIntrospector.MixInResolver
 {
     /**
-     * Enumeration that defines simple on/off features to set
-     * for {@link ObjectMapper}, and accessible (but NOT mutable!)
-     * via {@link SerializationConfig} and {@link DeserializationConfig}.
-     * Note that in addition to being only mutable via {@link ObjectMapper},
-     * changes only take effect when done <b>before any serialization or
-     * deserialization</b> calls -- that is, caller must follow
-     * "configure-then-use" pattern.
-     */
-    public enum Feature implements ConfigFeature
-    {
-        /*
-        /******************************************************
-        /*  Introspection features
-        /******************************************************
-         */
-        
-        /**
-         * Feature that determines whether annotation introspection
-         * is used for configuration; if enabled, configured
-         * {@link AnnotationIntrospector} will be used: if disabled,
-         * no annotations are considered.
-         *<p>
-         * Feature is enabled by default.
-         */
-        USE_ANNOTATIONS(true),
-
-        /**
-         * Feature that determines whether "creator" methods are
-         * automatically detected by consider public constructors,
-         * and static single argument methods with name "valueOf".
-         * If disabled, only methods explicitly annotated are considered
-         * creator methods (except for the no-arg default constructor which
-         * is always considered a factory method).
-         *<p>
-         * Note that this feature has lower precedence than per-class
-         * annotations, and is only used if there isn't more granular
-         * configuration available.
-         *<P>
-         * Feature is enabled by default.
-         */
-        AUTO_DETECT_CREATORS(true),
-        
-        /**
-         * Feature that determines whether non-static fields are recognized as
-         * properties.
-         * If yes, then all public member fields
-         * are considered as properties. If disabled, only fields explicitly
-         * annotated are considered property fields.
-         *<p>
-         * Note that this feature has lower precedence than per-class
-         * annotations, and is only used if there isn't more granular
-         * configuration available.
-         *<p>
-         * Feature is enabled by default.
-         */
-         AUTO_DETECT_FIELDS(true),
-        
-        /**
-         * Feature that determines whether regualr "getter" methods are
-         * automatically detected based on standard Bean naming convention
-         * or not. If yes, then all public zero-argument methods that
-         * start with prefix "get" 
-         * are considered as getters.
-         * If disabled, only methods explicitly  annotated are considered getters.
-         *<p>
-         * Note that since version 1.3, this does <b>NOT</b> include
-         * "is getters" (see {@link #AUTO_DETECT_IS_GETTERS} for details)
-         *<p>
-         * Note that this feature has lower precedence than per-class
-         * annotations, and is only used if there isn't more granular
-         * configuration available.
-         *<p>
-         * Feature is enabled by default.
-         */
-        AUTO_DETECT_GETTERS(true),
-
-        /**
-         * Feature that determines whether "is getter" methods are
-         * automatically detected based on standard Bean naming convention
-         * or not. If yes, then all public zero-argument methods that
-         * start with prefix "is", and whose return type is boolean
-         * are considered as "is getters".
-         * If disabled, only methods explicitly annotated are considered getters.
-         *<p>
-         * Note that this feature has lower precedence than per-class
-         * annotations, and is only used if there isn't more granular
-         * configuration available.
-         *<p>
-         * Feature is enabled by default.
-         */
-        AUTO_DETECT_IS_GETTERS(true),
-
-         /**
-          * Feature that determines whether "setter" methods are
-          * automatically detected based on standard Bean naming convention
-          * or not. If yes, then all public one-argument methods that
-          * start with prefix "set"
-          * are considered setters. If disabled, only methods explicitly
-          * annotated are considered setters.
-          *<p>
-          * Note that this feature has lower precedence than per-class
-          * annotations, and is only used if there isn't more granular
-          * configuration available.
-          *<P>
-          * Feature is enabled by default.
-          */
-         AUTO_DETECT_SETTERS(true),
-         
-         /**
-          * Feature that determines whether getters (getter methods)
-          * can be auto-detected if there is no matching mutator (setter,
-          * constructor parameter or field) or not: if set to true,
-          * only getters that match a mutator are auto-discovered; if
-          * false, all auto-detectable getters can be discovered.
-          *<p>
-          * Feature is disabled by default.
-          */
-         REQUIRE_SETTERS_FOR_GETTERS(false),
-
-         /**
-          * Feature that determines whether otherwise regular "getter"
-          * methods (but only ones that handle Collections and Maps,
-          * not getters of other type)
-          * can be used for purpose of getting a reference to a Collection
-          * and Map to modify the property, without requiring a setter
-          * method.
-          * This is similar to how JAXB framework sets Collections and
-          * Maps: no setter is involved, just setter.
-          *<p>
-          * Note that such getters-as-setters methods have lower
-          * precedence than setters, so they are only used if no
-          * setter is found for the Map/Collection property.
-          *<p>
-          * Feature is enabled by default.
-          */
-         USE_GETTERS_AS_SETTERS(true),
-
-         /**
-         * Feature that determines whether method and field access
-         * modifier settings can be overridden when accessing
-         * properties. If enabled, method
-         * {@link java.lang.reflect.AccessibleObject#setAccessible}
-         * may be called to enable access to otherwise unaccessible
-         * objects.
-         *<p>
-         * Feature is enabled by default.
-         */
-        CAN_OVERRIDE_ACCESS_MODIFIERS(true),
-
-        /*
-        /******************************************************
-        /* Type-handling features
-        /******************************************************
-         */
-
-        /**
-         * Feature that determines whether the type detection for
-         * serialization should be using actual dynamic runtime type,
-         * or declared static type.
-         * Note that deserialization always uses declared static types
-         * since no runtime types are available (as we are creating
-         * instances after using type information).
-         *<p>
-         * This global default value can be overridden at class, method
-         * or field level by using {@link JsonSerialize#typing} annotation
-         * property.
-         *<p>
-         * Feature is disabled by default which means that dynamic runtime types
-         * are used (instead of declared static types) for serialization.
-         */
-        USE_STATIC_TYPING(false),
-
-        /*
-        /******************************************************
-        /* View-related features
-        /******************************************************
-         */
-        
-        /**
-         * Feature that determines whether properties that have no view
-         * annotations are included in JSON serialization views (see
-         * {@link com.fasterxml.jackson.annotation.JsonView} for more
-         * details on JSON Views).
-         * If enabled, non-annotated properties will be included;
-         * when disabled, they will be excluded. So this feature
-         * changes between "opt-in" (feature disabled) and
-         * "opt-out" (feature enabled) modes.
-         *<p>
-         * Default value is enabled, meaning that non-annotated
-         * properties are included in all views if there is no
-         * {@link com.fasterxml.jackson.annotation.JsonView} annotation.
-         *<p>
-         * Feature is enabled by default.
-         */
-        DEFAULT_VIEW_INCLUSION(true),
-        
-        /*
-        /******************************************************
-        /* Generic output features
-        /******************************************************
-         */
-
-        /**
-         * Feature that defines default property serialization order used
-         * for POJO fields (note: does <b>not</b> apply to {@link java.util.Map}
-         * serialization!):
-         * if enabled, default ordering is alphabetic (similar to
-         * how {@link com.fasterxml.jackson.annotation.JsonPropertyOrder#alphabetic()}
-         * works); if disabled, order is unspecified (based on what JDK gives
-         * us, which may be declaration order, but is not guaranteed).
-         *<p>
-         * Note that this is just the default behavior, and can be overridden by
-         * explicit overrides in classes.
-         *<p>
-         * Feature is disabled by default.
-         */
-        SORT_PROPERTIES_ALPHABETICALLY(false)
-
-        ;
-
-        private final boolean _defaultState;
-        
-        private Feature(boolean defaultState) {
-            _defaultState = defaultState;
-        }
-        
-        @Override
-        public boolean enabledByDefault() { return _defaultState; }
-
-        @Override
-        public int getMask() { return (1 << ordinal()); }
-    }
-    
-    /*
-    /**********************************************************
-    /* Simple immutable basic settings
-    /**********************************************************
-     */
-
-    /**
      * Set of shared mapper features enabled.
      */
     protected final int _mapperFeatures;
@@ -323,13 +82,13 @@
      * Method for constructing and returning a new instance with specified
      * mapper features enabled.
      */
-    public abstract T with(MapperConfig.Feature... features);
+    public abstract T with(MapperFeature... features);
 
     /**
      * Method for constructing and returning a new instance with specified
      * mapper features disabled.
      */
-    public abstract T without(MapperConfig.Feature... features);
+    public abstract T without(MapperFeature... features);
     
     /*
     /**********************************************************
@@ -341,7 +100,7 @@
      * Accessor for simple mapper features (which are shared for
      * serialization, deserialization)
      */
-    public final boolean isEnabled(MapperConfig.Feature f) {
+    public final boolean isEnabled(MapperFeature f) {
         return (_mapperFeatures & f.getMask()) != 0;
     }
     
@@ -352,7 +111,7 @@
      * @return True if annotation processing is enabled; false if not
      */
     public final boolean isAnnotationProcessingEnabled() {
-        return isEnabled(MapperConfig.Feature.USE_ANNOTATIONS);
+        return isEnabled(MapperFeature.USE_ANNOTATIONS);
     }
 
     /**
@@ -367,7 +126,7 @@
      *   to override.
      */
     public final boolean canOverrideAccessModifiers() {
-        return isEnabled(MapperConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS);
+        return isEnabled(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS);
     }
 
     /**
@@ -375,7 +134,7 @@
      * indicate that properties should be alphabetically ordered or not.
      */
     public final boolean shouldSortPropertiesAlphabetically() {
-        return isEnabled(MapperConfig.Feature.SORT_PROPERTIES_ALPHABETICALLY);
+        return isEnabled(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY);
     }
 
     /**
diff --git a/src/main/java/com/fasterxml/jackson/databind/cfg/MapperConfigBase.java b/src/main/java/com/fasterxml/jackson/databind/cfg/MapperConfigBase.java
index 4b458dd..a52b3d9 100644
--- a/src/main/java/com/fasterxml/jackson/databind/cfg/MapperConfigBase.java
+++ b/src/main/java/com/fasterxml/jackson/databind/cfg/MapperConfigBase.java
@@ -6,7 +6,7 @@
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
 import com.fasterxml.jackson.annotation.PropertyAccessor;
 import com.fasterxml.jackson.databind.AnnotationIntrospector;
-import com.fasterxml.jackson.databind.HandlerInstantiator;
+import com.fasterxml.jackson.databind.MapperFeature;
 import com.fasterxml.jackson.databind.PropertyNamingStrategy;
 import com.fasterxml.jackson.databind.introspect.ClassIntrospector;
 import com.fasterxml.jackson.databind.introspect.VisibilityChecker;
@@ -19,7 +19,7 @@
     T extends MapperConfigBase<CFG,T>>
     extends MapperConfig<T>
 {
-    private final static int DEFAULT_MAPPER_FEATURES = collectFeatureDefaults(MapperConfig.Feature.class);
+    private final static int DEFAULT_MAPPER_FEATURES = collectFeatureDefaults(MapperFeature.class);
 
     /*
     /**********************************************************
@@ -204,7 +204,7 @@
      * Note that when a root name is set to a non-Empty String, this will automatically force use
      * of root element wrapping with given name. If empty String passed, will
      * disable root name wrapping; and if null used, will instead use
-     * <code>Feature</code> to determine if to use wrapping, and annotation
+     * <code>SerializationFeature</code> to determine if to use wrapping, and annotation
      * (or default name) for actual root name to use.
      * 
      * @param rootName to use: if null, means "use default" (clear setting);
diff --git a/src/main/java/com/fasterxml/jackson/databind/cfg/SerializationConfig.java b/src/main/java/com/fasterxml/jackson/databind/cfg/SerializationConfig.java
new file mode 100644
index 0000000..c9e9f4a
--- /dev/null
+++ b/src/main/java/com/fasterxml/jackson/databind/cfg/SerializationConfig.java
@@ -0,0 +1,475 @@
+package com.fasterxml.jackson.databind.cfg;
+
+import java.text.DateFormat;
+import java.util.*;
+
+import com.fasterxml.jackson.annotation.*;
+import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
+import com.fasterxml.jackson.databind.AnnotationIntrospector;
+import com.fasterxml.jackson.databind.BeanDescription;
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.MapperFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.ObjectWriter;
+import com.fasterxml.jackson.databind.PropertyNamingStrategy;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.introspect.ClassIntrospector;
+import com.fasterxml.jackson.databind.introspect.VisibilityChecker;
+import com.fasterxml.jackson.databind.jsontype.SubtypeResolver;
+import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder;
+import com.fasterxml.jackson.databind.ser.FilterProvider;
+import com.fasterxml.jackson.databind.ser.SerializerFactory;
+import com.fasterxml.jackson.databind.type.ClassKey;
+import com.fasterxml.jackson.databind.type.TypeFactory;
+
+/**
+ * Object that contains baseline configuration for serialization
+ * process. An instance is owned by {@link ObjectMapper}, which
+ * passes an immutable instance for serialization process to
+ * {@link SerializerProvider} and {@link SerializerFactory}
+ * (either directly, or through {@link ObjectWriter}.
+ *<p>
+ * Note that instances are considered immutable and as such no copies
+ * should need to be created (there are some implementation details
+ * with respect to mix-in annotations; where this is guaranteed as
+ * long as caller follow "copy-then-use" pattern)
+ */
+public final class SerializationConfig
+    extends MapperConfigBase<SerializationFeature, SerializationConfig>
+{
+    /**
+     * Set of features enabled; actual type (kind of features)
+     * depends on sub-classes.
+     */
+    protected final int _serFeatures;
+    
+    /**
+     * Which Bean/Map properties are to be included in serialization?
+     * Default settings is to include all regardless of value; can be
+     * changed to only include non-null properties, or properties
+     * with non-default values.
+     */
+    protected JsonInclude.Include _serializationInclusion = null;
+    
+    /**
+     * Object used for resolving filter ids to filter instances.
+     * Non-null if explicitly defined; null by default.
+     */
+    protected final FilterProvider _filterProvider;
+    
+    /*
+    /**********************************************************
+    /* Life-cycle, constructors
+    /**********************************************************
+     */
+
+    /**
+     * Constructor used by ObjectMapper to create default configuration object instance.
+     */
+    public SerializationConfig(BaseSettings base,
+            SubtypeResolver str, Map<ClassKey,Class<?>> mixins)
+    {
+        super(base, str, mixins);
+        _serFeatures = collectFeatureDefaults(SerializationFeature.class);
+        _filterProvider = null;
+    }
+    
+    private SerializationConfig(SerializationConfig src, SubtypeResolver str)
+    {
+        super(src, str);
+        _serFeatures = src._serFeatures;
+        _serializationInclusion = src._serializationInclusion;
+        _filterProvider = src._filterProvider;
+    }
+
+    private SerializationConfig(SerializationConfig src,
+            int mapperFeatures, int serFeatures)
+    {
+        super(src, mapperFeatures);
+        _serFeatures = serFeatures;
+        _serializationInclusion = src._serializationInclusion;
+        _filterProvider = src._filterProvider;
+    }
+    
+    private SerializationConfig(SerializationConfig src, BaseSettings base)
+    {
+        super(src, base);
+        _serFeatures = src._serFeatures;
+        _serializationInclusion = src._serializationInclusion;
+        _filterProvider = src._filterProvider;
+    }
+
+    private SerializationConfig(SerializationConfig src, FilterProvider filters)
+    {
+        super(src);
+        _serFeatures = src._serFeatures;
+        _serializationInclusion = src._serializationInclusion;
+        _filterProvider = filters;
+    }
+
+    private SerializationConfig(SerializationConfig src, Class<?> view)
+    {
+        super(src, view);
+        _serFeatures = src._serFeatures;
+        _serializationInclusion = src._serializationInclusion;
+        _filterProvider = src._filterProvider;
+    }
+
+    private SerializationConfig(SerializationConfig src, JsonInclude.Include incl)
+    {
+        super(src);
+        _serFeatures = src._serFeatures;
+        _serializationInclusion = incl;
+        _filterProvider = src._filterProvider;
+    }
+
+    private SerializationConfig(SerializationConfig src, String rootName)
+    {
+        super(src, rootName);
+        _serFeatures = src._serFeatures;
+        _serializationInclusion = src._serializationInclusion;
+        _filterProvider = src._filterProvider;
+    }
+    
+    /*
+    /**********************************************************
+    /* Life-cycle, factory methods from MapperConfig
+    /**********************************************************
+     */
+
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified features enabled.
+     */
+    @Override
+    public SerializationConfig with(MapperFeature... features)
+    {
+        int newMapperFlags = _mapperFeatures;
+        for (MapperFeature f : features) {
+            newMapperFlags |= f.getMask();
+        }
+        return (newMapperFlags == _mapperFeatures) ? this
+                : new SerializationConfig(this, newMapperFlags, _serFeatures);
+    }
+    
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified features disabled.
+     */
+    @Override
+    public SerializationConfig without(MapperFeature... features)
+    {
+        int newMapperFlags = _mapperFeatures;
+        for (MapperFeature f : features) {
+             newMapperFlags &= ~f.getMask();
+        }
+        return (newMapperFlags == _mapperFeatures) ? this
+                : new SerializationConfig(this, newMapperFlags, _serFeatures);
+    }
+
+    @Override
+    public SerializationConfig withAnnotationIntrospector(AnnotationIntrospector ai) {
+        return _withBase(_base.withAnnotationIntrospector(ai));
+    }
+
+    @Override
+    public SerializationConfig withAppendedAnnotationIntrospector(AnnotationIntrospector ai) {
+        return _withBase(_base.withAppendedAnnotationIntrospector(ai));
+    }
+
+    @Override
+    public SerializationConfig withInsertedAnnotationIntrospector(AnnotationIntrospector ai) {
+        return _withBase(_base.withInsertedAnnotationIntrospector(ai));
+    }
+
+    @Override
+    public SerializationConfig withClassIntrospector(ClassIntrospector ci) {
+        return _withBase(_base.withClassIntrospector(ci));
+    }
+    
+    /**
+     * In addition to constructing instance with specified date format,
+     * will enable or disable <code>SerializationFeature.WRITE_DATES_AS_TIMESTAMPS</code>
+     * (enable if format set as null; disable if non-null)
+     */
+    @Override
+    public SerializationConfig withDateFormat(DateFormat df) {
+        SerializationConfig cfg =  new SerializationConfig(this, _base.withDateFormat(df));
+        // Also need to toggle this feature based on existence of date format:
+        if (df == null) {
+            cfg = cfg.with(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
+        } else {
+            cfg = cfg.without(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
+        }
+        return cfg;
+    }
+    
+    @Override
+    public SerializationConfig withHandlerInstantiator(HandlerInstantiator hi) {
+        return _withBase(_base.withHandlerInstantiator(hi));
+    }
+    
+    @Override
+    public SerializationConfig withPropertyNamingStrategy(PropertyNamingStrategy pns) {
+        return _withBase(_base.withPropertyNamingStrategy(pns));
+    }
+
+    @Override
+    public SerializationConfig withRootName(String rootName) {
+        if (rootName == null) {
+            if (_rootName == null) {
+                return this;
+            }
+        } else if (rootName.equals(_rootName)) {
+            return this;
+        }
+        return new SerializationConfig(this, rootName);
+    }
+
+    @Override
+    public SerializationConfig withSubtypeResolver(SubtypeResolver str) {
+        return (str == _subtypeResolver)? this : new SerializationConfig(this, str);
+    }
+
+    @Override
+    public SerializationConfig withTypeFactory(TypeFactory tf) {
+        return _withBase(_base.withTypeFactory(tf));
+    }
+
+    @Override
+    public SerializationConfig withTypeResolverBuilder(TypeResolverBuilder<?> trb) {
+        return _withBase(_base.withTypeResolverBuilder(trb));
+    }
+    
+    public SerializationConfig withView(Class<?> view) {
+        return (_view == view) ? this : new SerializationConfig(this, view);
+    }
+
+    @Override
+    public SerializationConfig withVisibilityChecker(VisibilityChecker<?> vc) {
+        return _withBase(_base.withVisibilityChecker(vc));
+    }
+
+    @Override
+    public SerializationConfig withVisibility(PropertyAccessor forMethod, JsonAutoDetect.Visibility visibility) {
+        return _withBase(_base.withVisibility(forMethod, visibility));
+    }
+    
+    private final SerializationConfig _withBase(BaseSettings newBase) {
+        return (_base == newBase) ? this : new SerializationConfig(this, newBase);
+    }
+    
+    /*
+    /**********************************************************
+    /* Life-cycle, SerializationConfig specific factory methods
+    /**********************************************************
+     */
+        
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified feature enabled.
+     */
+    public SerializationConfig with(SerializationFeature feature)
+    {
+        int newSerFeatures = _serFeatures | feature.getMask();
+        return (newSerFeatures == _serFeatures) ? this
+                : new SerializationConfig(this, _mapperFeatures, newSerFeatures);
+    }
+
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified features enabled.
+     */
+    public SerializationConfig with(SerializationFeature first, SerializationFeature... features)
+    {
+        int newSerFeatures = _serFeatures | first.getMask();
+        for (SerializationFeature f : features) {
+            newSerFeatures |= f.getMask();
+        }
+        return (newSerFeatures == _serFeatures) ? this
+                : new SerializationConfig(this, _mapperFeatures, newSerFeatures);
+    }
+    
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified features enabled.
+     */
+    public SerializationConfig withFeatures(SerializationFeature... features)
+    {
+        int newSerFeatures = _serFeatures;
+        for (SerializationFeature f : features) {
+            newSerFeatures |= f.getMask();
+        }
+        return (newSerFeatures == _serFeatures) ? this
+                : new SerializationConfig(this, _mapperFeatures, newSerFeatures);
+    }
+
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified feature disabled.
+     */
+    public SerializationConfig without(SerializationFeature feature)
+    {
+        int newSerFeatures = _serFeatures & ~feature.getMask();
+        return (newSerFeatures == _serFeatures) ? this
+                : new SerializationConfig(this, _mapperFeatures, newSerFeatures);
+    }
+
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified features disabled.
+     */
+    public SerializationConfig without(SerializationFeature first, SerializationFeature... features)
+    {
+        int newSerFeatures = _serFeatures & ~first.getMask();
+        for (SerializationFeature f : features) {
+            newSerFeatures &= ~f.getMask();
+        }
+        return (newSerFeatures == _serFeatures) ? this
+                : new SerializationConfig(this, _mapperFeatures, newSerFeatures);
+    }
+
+    /**
+     * Fluent factory method that will construct and return a new configuration
+     * object instance with specified features disabled.
+     */
+    public SerializationConfig withoutFeatures(SerializationFeature... features)
+    {
+        int newSerFeatures = _serFeatures;
+        for (SerializationFeature f : features) {
+            newSerFeatures &= ~f.getMask();
+        }
+        return (newSerFeatures == _serFeatures) ? this
+                : new SerializationConfig(this, _mapperFeatures, newSerFeatures);
+    }
+    
+    public SerializationConfig withFilters(FilterProvider filterProvider) {
+        return (filterProvider == _filterProvider) ? this : new SerializationConfig(this, filterProvider);
+    }
+
+    public SerializationConfig withSerializationInclusion(JsonInclude.Include incl) {
+        return (_serializationInclusion == incl) ? this:  new SerializationConfig(this, incl);
+    }
+    
+    /*
+    /**********************************************************
+    /* MapperConfig implementation/overrides
+    /**********************************************************
+     */
+    
+    @Override
+    public boolean useRootWrapping()
+    {
+        if (_rootName != null) { // empty String disables wrapping; non-empty enables
+            return (_rootName.length() > 0);
+        }
+        return isEnabled(SerializationFeature.WRAP_ROOT_VALUE);
+    }
+    
+    @Override
+    public AnnotationIntrospector getAnnotationIntrospector()
+    {
+        /* 29-Jul-2009, tatu: it's now possible to disable use of
+         *   annotations; can be done using "no-op" introspector
+         */
+        if (isEnabled(MapperFeature.USE_ANNOTATIONS)) {
+            return super.getAnnotationIntrospector();
+        }
+        return AnnotationIntrospector.nopInstance();
+    }
+
+    /**
+     * Accessor for getting bean description that only contains class
+     * annotations: useful if no getter/setter/creator information is needed.
+     */
+    @Override
+    public BeanDescription introspectClassAnnotations(JavaType type) {
+        return getClassIntrospector().forClassAnnotations(this, type, this);
+    }
+
+    /**
+     * Accessor for getting bean description that only contains immediate class
+     * annotations: ones from the class, and its direct mix-in, if any, but
+     * not from super types.
+     */
+    @Override
+    public BeanDescription introspectDirectClassAnnotations(JavaType type) {
+        return getClassIntrospector().forDirectClassAnnotations(this, type, this);
+    }
+    
+    @Override
+    public VisibilityChecker<?> getDefaultVisibilityChecker()
+    {
+        VisibilityChecker<?> vchecker = super.getDefaultVisibilityChecker();
+        if (!isEnabled(MapperFeature.AUTO_DETECT_GETTERS)) {
+            vchecker = vchecker.withGetterVisibility(Visibility.NONE);
+        }
+        // then global overrides (disabling)
+        if (!isEnabled(MapperFeature.AUTO_DETECT_IS_GETTERS)) {
+            vchecker = vchecker.withIsGetterVisibility(Visibility.NONE);
+        }
+        if (!isEnabled(MapperFeature.AUTO_DETECT_FIELDS)) {
+            vchecker = vchecker.withFieldVisibility(Visibility.NONE);
+        }
+        return vchecker;
+    }
+    
+    /*
+    /**********************************************************
+    /* Configuration: other
+    /**********************************************************
+     */
+
+    public final boolean isEnabled(SerializationFeature f) {
+        return (_serFeatures & f.getMask()) != 0;
+    }
+    
+    public final int getSerializationFeatures() {
+        return _serFeatures;
+    }
+    
+    public JsonInclude.Include getSerializationInclusion()
+    {
+        if (_serializationInclusion != null) {
+            return _serializationInclusion;
+        }
+        return JsonInclude.Include.ALWAYS;
+    }
+    
+    /**
+     * Method for getting provider used for locating filters given
+     * id (which is usually provided with filter annotations).
+     * Will be null if no provided was set for {@link ObjectWriter}
+     * (or if serialization directly called from {@link ObjectMapper})
+     */
+    public FilterProvider getFilterProvider() {
+        return _filterProvider;
+    }
+
+    /*
+    /**********************************************************
+    /* Introspection methods
+    /**********************************************************
+     */
+
+    /**
+     * Method that will introspect full bean properties for the purpose
+     * of building a bean serializer
+     */
+    @SuppressWarnings("unchecked")
+    public <T extends BeanDescription> T introspect(JavaType type) {
+        return (T) getClassIntrospector().forSerialization(this, type, this);
+    }
+    
+    /*
+    /**********************************************************
+    /* Debug support
+    /**********************************************************
+     */
+    
+    @Override public String toString()
+    {
+        return "[SerializationConfig: flags=0x"+Integer.toHexString(_serFeatures)+"]";
+    }
+}
diff --git a/src/main/java/com/fasterxml/jackson/databind/cfg/package-info.java b/src/main/java/com/fasterxml/jackson/databind/cfg/package-info.java
new file mode 100644
index 0000000..5afd53a
--- /dev/null
+++ b/src/main/java/com/fasterxml/jackson/databind/cfg/package-info.java
@@ -0,0 +1,8 @@
+/**
+Package that contains most of configuration-related classes;
+exception being couple of most-commonly used configuration
+things (like Feature enumerations) that are at the
+main level (<code>com.fasterxml.jackson.databind</code>).
+*/
+
+package com.fasterxml.jackson.databind.cfg;
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java b/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
index 016c7d7..efa4e17 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/BasicDeserializerFactory.java
@@ -6,7 +6,9 @@
 
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.databind.annotation.NoClass;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.cfg.DeserializerFactoryConfig;
+import com.fasterxml.jackson.databind.cfg.HandlerInstantiator;
 import com.fasterxml.jackson.databind.deser.impl.CreatorCollector;
 import com.fasterxml.jackson.databind.deser.std.*;
 import com.fasterxml.jackson.databind.ext.OptionalHandlerFactory;
@@ -1421,7 +1423,7 @@
             return EnumResolver.constructUnsafeUsingMethod(enumClass, accessor);
         }
         // [JACKSON-212]: may need to use Enum.toString()
-        if (config.isEnabled(DeserializationConfig.Feature.READ_ENUMS_USING_TO_STRING)) {
+        if (config.isEnabled(DeserializationFeature.READ_ENUMS_USING_TO_STRING)) {
             return EnumResolver.constructUnsafeUsingToString(enumClass);
         }
         return EnumResolver.constructUnsafe(enumClass, config.getAnnotationIntrospector());
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java
index b20fbfd..42c1a22 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java
@@ -1582,7 +1582,7 @@
         if (t instanceof Error) {
             throw (Error) t;
         }
-        boolean wrap = (ctxt == null) || ctxt.isEnabled(DeserializationConfig.Feature.WRAP_EXCEPTIONS);
+        boolean wrap = (ctxt == null) || ctxt.isEnabled(DeserializationFeature.WRAP_EXCEPTIONS);
         // Ditto for IOExceptions; except we may want to wrap mapping exceptions
         if (t instanceof IOException) {
             if (!wrap || !(t instanceof JsonMappingException)) {
@@ -1607,7 +1607,7 @@
         if (t instanceof Error) {
             throw (Error) t;
         }
-        boolean wrap = (ctxt == null) || ctxt.isEnabled(DeserializationConfig.Feature.WRAP_EXCEPTIONS);
+        boolean wrap = (ctxt == null) || ctxt.isEnabled(DeserializationFeature.WRAP_EXCEPTIONS);
         // Ditto for IOExceptions; except we may want to wrap mapping exceptions
         if (t instanceof IOException) {
             if (!wrap || !(t instanceof JsonMappingException)) {
@@ -1632,7 +1632,7 @@
         if (t instanceof Error) {
             throw (Error) t;
         }
-        boolean wrap = (ctxt == null) || ctxt.isEnabled(DeserializationConfig.Feature.WRAP_EXCEPTIONS);
+        boolean wrap = (ctxt == null) || ctxt.isEnabled(DeserializationFeature.WRAP_EXCEPTIONS);
         if (t instanceof IOException) {
             // Since we have no more information to add, let's not actually wrap..
             throw (IOException) t;
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerBuilder.java b/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerBuilder.java
index 025d793..04c0543 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerBuilder.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerBuilder.java
@@ -4,7 +4,7 @@
 
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.deser.impl.BeanPropertyMap;
 import com.fasterxml.jackson.databind.deser.impl.ValueInjector;
 import com.fasterxml.jackson.databind.introspect.AnnotatedMember;
@@ -83,7 +83,7 @@
             DeserializationConfig config)
     { 
         _beanDesc = beanDesc;
-        _defaultViewInclusion = config.isEnabled(MapperConfig.Feature.DEFAULT_VIEW_INCLUSION);
+        _defaultViewInclusion = config.isEnabled(MapperFeature.DEFAULT_VIEW_INCLUSION);
     }
 
     /**
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerFactory.java b/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerFactory.java
index 7ecbc2c..fb1c061 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerFactory.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerFactory.java
@@ -5,8 +5,8 @@
 import java.util.concurrent.atomic.AtomicReference;
 
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.cfg.DeserializerFactoryConfig;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 import com.fasterxml.jackson.databind.deser.impl.DeserializerCache;
 import com.fasterxml.jackson.databind.deser.std.JdkDeserializers;
 import com.fasterxml.jackson.databind.deser.std.ThrowableDeserializer;
@@ -395,8 +395,8 @@
                 }
             }
         }
-        final boolean useGettersAsSetters = (ctxt.isEnabled(MapperConfig.Feature.USE_GETTERS_AS_SETTERS)
-                && ctxt.isEnabled(MapperConfig.Feature.AUTO_DETECT_GETTERS));
+        final boolean useGettersAsSetters = (ctxt.isEnabled(MapperFeature.USE_GETTERS_AS_SETTERS)
+                && ctxt.isEnabled(MapperFeature.AUTO_DETECT_GETTERS));
 
         // Ok: let's then filter out property definitions
         List<BeanPropertyDefinition> propDefs = filterBeanProps(ctxt,
@@ -444,7 +444,7 @@
                 Class<?>[] views = propDef.findViews();
                 if (views == null) {
                     // one more twist: if default inclusion disabled, need to force empty set of views
-                    if (!ctxt.isEnabled(MapperConfig.Feature.DEFAULT_VIEW_INCLUSION)) {
+                    if (!ctxt.isEnabled(MapperFeature.DEFAULT_VIEW_INCLUSION)) {
                         views = NO_VIEWS;
                     }
                 }
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerModifier.java b/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerModifier.java
index 705d539..55e10fb 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerModifier.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializerModifier.java
@@ -3,6 +3,7 @@
 import java.util.List;
 
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.deser.BeanDeserializer;
 import com.fasterxml.jackson.databind.deser.BeanDeserializerFactory;
 
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/DeserializationProblemHandler.java b/src/main/java/com/fasterxml/jackson/databind/deser/DeserializationProblemHandler.java
index 015b2f6..3ff4da3 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/DeserializationProblemHandler.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/DeserializationProblemHandler.java
@@ -4,10 +4,10 @@
 
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.JsonDeserializer;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 
 /**
  * This is the class that can be registered (via
@@ -40,7 +40,7 @@
      *</pre>
      *<p>
      * Note: version 1.2 added new deserialization feature
-     * (<code>DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES</code>).
+     * (<code>DeserializationConfig.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES</code>).
      * It will only have effect <b>after</b> handler is called, and only
      * if handler did <b>not</b> handle the problem.
      *
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/DeserializerFactory.java b/src/main/java/com/fasterxml/jackson/databind/deser/DeserializerFactory.java
index b709252..00a76f7 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/DeserializerFactory.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/DeserializerFactory.java
@@ -1,6 +1,7 @@
 package com.fasterxml.jackson.databind.deser;
 
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
 import com.fasterxml.jackson.databind.type.*;
 
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/Deserializers.java b/src/main/java/com/fasterxml/jackson/databind/deser/Deserializers.java
index e83f940..90e9a3b 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/Deserializers.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/Deserializers.java
@@ -1,7 +1,7 @@
 package com.fasterxml.jackson.databind.deser;
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.KeyDeserializer;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
 import com.fasterxml.jackson.databind.type.*;
 
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/KeyDeserializers.java b/src/main/java/com/fasterxml/jackson/databind/deser/KeyDeserializers.java
index 652170b..b9d7fec 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/KeyDeserializers.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/KeyDeserializers.java
@@ -1,6 +1,7 @@
 package com.fasterxml.jackson.databind.deser;
 
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 
 /**
  * Interface that defines API for simple extensions that can provide additional deserializers
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/SettableBeanProperty.java b/src/main/java/com/fasterxml/jackson/databind/deser/SettableBeanProperty.java
index 298db33..2c2a627 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/SettableBeanProperty.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/SettableBeanProperty.java
@@ -876,9 +876,9 @@
 
         public Object nullValue(DeserializationContext ctxt) throws JsonProcessingException
         {
-            if (_isPrimitive && ctxt.isEnabled(DeserializationConfig.Feature.FAIL_ON_NULL_FOR_PRIMITIVES)) {
+            if (_isPrimitive && ctxt.isEnabled(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES)) {
                 throw ctxt.mappingException("Can not map JSON null into type "+_rawType.getName()
-                        +" (set DeserializationConfig.Feature.FAIL_ON_NULL_FOR_PRIMITIVES to 'false' to allow)");
+                        +" (set DeserializationConfig.DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES to 'false' to allow)");
             }
             return _nullValue;
         }
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/ValueInstantiator.java b/src/main/java/com/fasterxml/jackson/databind/deser/ValueInstantiator.java
index d952af3..b61c40a 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/ValueInstantiator.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/ValueInstantiator.java
@@ -3,10 +3,10 @@
 import java.io.IOException;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.JavaType;
 import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.introspect.AnnotatedWithParams;
 
 
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/ValueInstantiators.java b/src/main/java/com/fasterxml/jackson/databind/deser/ValueInstantiators.java
index 59e5eac..ba1e429 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/ValueInstantiators.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/ValueInstantiators.java
@@ -1,6 +1,7 @@
 package com.fasterxml.jackson.databind.deser;
 
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 
 /**
  * Interface for providers of {@link ValueInstantiator} instances.
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/impl/CreatorCollector.java b/src/main/java/com/fasterxml/jackson/databind/deser/impl/CreatorCollector.java
index 57a80c4..f61832c 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/impl/CreatorCollector.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/impl/CreatorCollector.java
@@ -5,8 +5,8 @@
 
 
 import com.fasterxml.jackson.databind.BeanDescription;
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.deser.CreatorProperty;
 import com.fasterxml.jackson.databind.deser.ValueInstantiator;
 import com.fasterxml.jackson.databind.deser.std.StdValueInstantiator;
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/impl/DeserializerCache.java b/src/main/java/com/fasterxml/jackson/databind/deser/impl/DeserializerCache.java
index 301c478..44ecdae 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/impl/DeserializerCache.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/impl/DeserializerCache.java
@@ -5,6 +5,7 @@
 
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.databind.annotation.NoClass;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.deser.ContextualDeserializer;
 import com.fasterxml.jackson.databind.deser.DeserializerFactory;
 import com.fasterxml.jackson.databind.deser.ResolvableDeserializer;
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/CollectionDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/CollectionDeserializer.java
index a5bbab5..3219026 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/CollectionDeserializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/CollectionDeserializer.java
@@ -251,7 +251,7 @@
         throws IOException, JsonProcessingException
     {
         // [JACKSON-526]: implicit arrays from single values?
-        if (!ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
+        if (!ctxt.isEnabled(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
             throw ctxt.mappingException(_collectionType.getRawClass());
         }
         JsonDeserializer<Object> valueDes = _valueDeserializer;
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/EnumDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/EnumDeserializer.java
index c3089ed..dc7c54e 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/EnumDeserializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/EnumDeserializer.java
@@ -5,9 +5,10 @@
 
 import com.fasterxml.jackson.core.*;
 
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.introspect.AnnotatedMethod;
 import com.fasterxml.jackson.databind.util.ClassUtil;
 import com.fasterxml.jackson.databind.util.EnumResolver;
@@ -80,8 +81,8 @@
             /* ... unless told not to do that. :-)
              * (as per [JACKSON-412]
              */
-            if (ctxt.isEnabled(DeserializationConfig.Feature.FAIL_ON_NUMBERS_FOR_ENUMS)) {
-                throw ctxt.mappingException("Not allowed to deserialize Enum value out of JSON number (disable DeserializationConfig.Feature.FAIL_ON_NUMBERS_FOR_ENUMS to allow)");
+            if (ctxt.isEnabled(DeserializationFeature.FAIL_ON_NUMBERS_FOR_ENUMS)) {
+                throw ctxt.mappingException("Not allowed to deserialize Enum value out of JSON number (disable DeserializationConfig.DeserializationFeature.FAIL_ON_NUMBERS_FOR_ENUMS to allow)");
             }
             
             int index = jp.getIntValue();
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/JacksonDeserializers.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/JacksonDeserializers.java
index 2fbf85e..383c526 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/JacksonDeserializers.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/JacksonDeserializers.java
@@ -7,10 +7,10 @@
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonToken;
 import com.fasterxml.jackson.databind.BeanDescription;
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.DeserializationContext;
 import com.fasterxml.jackson.databind.JavaType;
 import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.deser.CreatorProperty;
 import com.fasterxml.jackson.databind.deser.ValueInstantiator;
 import com.fasterxml.jackson.databind.util.TokenBuffer;
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/JsonNodeDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/JsonNodeDeserializer.java
index 24e87ca..058bc8e 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/JsonNodeDeserializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/JsonNodeDeserializer.java
@@ -262,7 +262,7 @@
             {
                 JsonParser.NumberType nt = jp.getNumberType();
                 if (nt == JsonParser.NumberType.BIG_INTEGER
-                    || ctxt.isEnabled(DeserializationConfig.Feature.USE_BIG_INTEGER_FOR_INTS)) {
+                    || ctxt.isEnabled(DeserializationFeature.USE_BIG_INTEGER_FOR_INTS)) {
                     return nodeFactory.numberNode(jp.getBigIntegerValue());
                 }
                 if (nt == JsonParser.NumberType.INT) {
@@ -275,7 +275,7 @@
             {
                 JsonParser.NumberType nt = jp.getNumberType();
                 if (nt == JsonParser.NumberType.BIG_DECIMAL
-                    || ctxt.isEnabled(DeserializationConfig.Feature.USE_BIG_DECIMAL_FOR_FLOATS)) {
+                    || ctxt.isEnabled(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS)) {
                     return nodeFactory.numberNode(jp.getDecimalValue());
                 }
                 return nodeFactory.numberNode(jp.getDoubleValue());
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/NumberDeserializers.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/NumberDeserializers.java
index 83b422b..bd45246 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/NumberDeserializers.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/NumberDeserializers.java
@@ -7,8 +7,8 @@
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.core.JsonToken;
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
 import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
 
@@ -293,7 +293,7 @@
         {
             JsonToken t = jp.getCurrentToken();
             if (t == JsonToken.VALUE_NUMBER_INT) {
-                if (ctxt.isEnabled(DeserializationConfig.Feature.USE_BIG_INTEGER_FOR_INTS)) {
+                if (ctxt.isEnabled(DeserializationFeature.USE_BIG_INTEGER_FOR_INTS)) {
                     return jp.getBigIntegerValue();
                 }
                 return jp.getNumberValue();
@@ -301,7 +301,7 @@
                 /* [JACKSON-72]: need to allow overriding the behavior
                  * regarding which type to use
                  */
-                if (ctxt.isEnabled(DeserializationConfig.Feature.USE_BIG_DECIMAL_FOR_FLOATS)) {
+                if (ctxt.isEnabled(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS)) {
                     return jp.getDecimalValue();
                 }
                 return Double.valueOf(jp.getDoubleValue());
@@ -315,13 +315,13 @@
                 try {
                     if (text.indexOf('.') >= 0) { // floating point
                         // as per [JACKSON-72]:
-                        if (ctxt.isEnabled(DeserializationConfig.Feature.USE_BIG_DECIMAL_FOR_FLOATS)) {
+                        if (ctxt.isEnabled(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS)) {
                             return new BigDecimal(text);
                         }
                         return new Double(text);
                     }
                     // as per [JACKSON-100]:
-                    if (ctxt.isEnabled(DeserializationConfig.Feature.USE_BIG_INTEGER_FOR_INTS)) {
+                    if (ctxt.isEnabled(DeserializationFeature.USE_BIG_INTEGER_FOR_INTS)) {
                         return new BigInteger(text);
                     }
                     long value = Long.parseLong(text);
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/ObjectArrayDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/ObjectArrayDeserializer.java
index 0130250..30b1cc3 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/ObjectArrayDeserializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/ObjectArrayDeserializer.java
@@ -201,7 +201,7 @@
     {
         // [JACKSON-620] Empty String can become null...
         if ((jp.getCurrentToken() == JsonToken.VALUE_STRING)
-                && ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
+                && ctxt.isEnabled(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
             String str = jp.getText();
             if (str.length() == 0) {
                 return null;
@@ -209,7 +209,7 @@
         }
         
         // Can we do implicit coercion to a single-element array still?
-        if (!ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
+        if (!ctxt.isEnabled(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
             /* 04-Oct-2009, tatu: One exception; byte arrays are generally
              *   serialized as base64, so that should be handled
              */
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/PrimitiveArrayDeserializers.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/PrimitiveArrayDeserializers.java
index 96e94dd..faa38e3 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/PrimitiveArrayDeserializers.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/PrimitiveArrayDeserializers.java
@@ -140,10 +140,10 @@
             throws IOException, JsonProcessingException
         {
             // [JACKSON-526]: implicit arrays from single values?
-            if (!ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
+            if (!ctxt.isEnabled(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
                 // [JACKSON-620] Empty String can become null...
                 if ((jp.getCurrentToken() == JsonToken.VALUE_STRING)
-                        && ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
+                        && ctxt.isEnabled(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
                     String str = jp.getText();
                     if (str.length() == 0) {
                         return null;
@@ -255,12 +255,12 @@
         {
             // [JACKSON-620] Empty String can become null...
             if ((jp.getCurrentToken() == JsonToken.VALUE_STRING)
-                    && ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
+                    && ctxt.isEnabled(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
                 if (jp.getText().length() == 0) {
                     return null;
                 }
             }
-            if (!ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
+            if (!ctxt.isEnabled(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
                 throw ctxt.mappingException(_valueClass);
             }
             return new boolean[] { _parseBooleanPrimitive(jp, ctxt) };
@@ -329,12 +329,12 @@
         {
             // [JACKSON-620] Empty String can become null...
             if ((jp.getCurrentToken() == JsonToken.VALUE_STRING)
-                    && ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
+                    && ctxt.isEnabled(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
                 if (jp.getText().length() == 0) {
                     return null;
                 }
             }
-            if (!ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
+            if (!ctxt.isEnabled(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
                 throw ctxt.mappingException(_valueClass);
             }
             byte value;
@@ -386,12 +386,12 @@
         {
             // [JACKSON-620] Empty String can become null...
             if ((jp.getCurrentToken() == JsonToken.VALUE_STRING)
-                    && ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
+                    && ctxt.isEnabled(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
                 if (jp.getText().length() == 0) {
                     return null;
                 }
             }
-            if (!ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
+            if (!ctxt.isEnabled(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
                 throw ctxt.mappingException(_valueClass);
             }
             return new short[] { _parseShortPrimitive(jp, ctxt) };
@@ -432,12 +432,12 @@
         {
             // [JACKSON-620] Empty String can become null...
             if ((jp.getCurrentToken() == JsonToken.VALUE_STRING)
-                    && ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
+                    && ctxt.isEnabled(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
                 if (jp.getText().length() == 0) {
                     return null;
                 }
             }
-            if (!ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
+            if (!ctxt.isEnabled(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
                 throw ctxt.mappingException(_valueClass);
             }
             return new int[] { _parseIntPrimitive(jp, ctxt) };
@@ -477,12 +477,12 @@
         {
             // [JACKSON-620] Empty String can become null...
             if ((jp.getCurrentToken() == JsonToken.VALUE_STRING)
-                    && ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
+                    && ctxt.isEnabled(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
                 if (jp.getText().length() == 0) {
                     return null;
                 }
             }
-            if (!ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
+            if (!ctxt.isEnabled(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
                 throw ctxt.mappingException(_valueClass);
             }
             return new long[] { _parseLongPrimitive(jp, ctxt) };
@@ -523,12 +523,12 @@
         {
             // [JACKSON-620] Empty String can become null...
             if ((jp.getCurrentToken() == JsonToken.VALUE_STRING)
-                    && ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
+                    && ctxt.isEnabled(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
                 if (jp.getText().length() == 0) {
                     return null;
                 }
             }
-            if (!ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
+            if (!ctxt.isEnabled(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
                 throw ctxt.mappingException(_valueClass);
             }
             return new float[] { _parseFloatPrimitive(jp, ctxt) };
@@ -568,12 +568,12 @@
         {
             // [JACKSON-620] Empty String can become null...
             if ((jp.getCurrentToken() == JsonToken.VALUE_STRING)
-                    && ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
+                    && ctxt.isEnabled(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT)) {
                 if (jp.getText().length() == 0) {
                     return null;
                 }
             }
-            if (!ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
+            if (!ctxt.isEnabled(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
                 throw ctxt.mappingException(_valueClass);
             }
             return new double[] { _parseDoublePrimitive(jp, ctxt) };
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
index c8ba717..071c908 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/StdDeserializer.java
@@ -660,7 +660,7 @@
         throws IOException, JsonProcessingException
     {
         // throw exception if that's what we are expected to do
-        if (ctxt.isEnabled(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES)) {
+        if (ctxt.isEnabled(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)) {
             throw ctxt.unknownFieldException(instanceOrClass, fieldName);
         }
         // ... or if not, just ignore
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/StdKeyDeserializers.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/StdKeyDeserializers.java
index da35d26..76bbcfa 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/StdKeyDeserializers.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/StdKeyDeserializers.java
@@ -5,6 +5,7 @@
 import java.util.*;
 
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.introspect.AnnotatedMethod;
 import com.fasterxml.jackson.databind.type.*;
 import com.fasterxml.jackson.databind.util.ClassUtil;
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/StdValueInstantiator.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/StdValueInstantiator.java
index 5e209ec..7f4f407 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/StdValueInstantiator.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/StdValueInstantiator.java
@@ -3,10 +3,11 @@
 import java.io.IOException;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.JavaType;
 import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.deser.CreatorProperty;
 import com.fasterxml.jackson.databind.deser.SettableBeanProperty;
 import com.fasterxml.jackson.databind.deser.ValueInstantiator;
@@ -68,14 +69,14 @@
     public StdValueInstantiator(DeserializationConfig config, Class<?> valueType)
     {
         _cfgEmptyStringsAsObjects = (config == null) ? false
-                : config.isEnabled(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT);
+                : config.isEnabled(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT);
         _valueTypeDesc = (valueType == null) ? "UNKNOWN TYPE" : valueType.getName();
     }
     
     public StdValueInstantiator(DeserializationConfig config, JavaType valueType)
     {
         _cfgEmptyStringsAsObjects = (config == null) ? false
-                : config.isEnabled(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT);
+                : config.isEnabled(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT);
         _valueTypeDesc = (valueType == null) ? "UNKNOWN TYPE" : valueType.toString();
     }
     
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/StringCollectionDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/StringCollectionDeserializer.java
index 64f31bf..50bb0ae 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/StringCollectionDeserializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/StringCollectionDeserializer.java
@@ -212,7 +212,7 @@
         throws IOException, JsonProcessingException
     {
         // [JACKSON-526]: implicit arrays from single values?
-        if (!ctxt.isEnabled(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
+        if (!ctxt.isEnabled(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY)) {
             throw ctxt.mappingException(_collectionType.getRawClass());
         }
         // Strings are one of "native" (intrinsic) types, so there's never type deserializer involved
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/UntypedObjectDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/UntypedObjectDeserializer.java
index f776932..7e47682 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/UntypedObjectDeserializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/UntypedObjectDeserializer.java
@@ -5,8 +5,8 @@
 
 import com.fasterxml.jackson.core.*;
 
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.DeserializationFeature;
 import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
 import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
 import com.fasterxml.jackson.databind.util.ObjectBuffer;
@@ -59,7 +59,7 @@
             /* [JACKSON-100]: caller may want to get all integral values
              * returned as BigInteger, for consistency
              */
-            if (ctxt.isEnabled(DeserializationConfig.Feature.USE_BIG_INTEGER_FOR_INTS)) {
+            if (ctxt.isEnabled(DeserializationFeature.USE_BIG_INTEGER_FOR_INTS)) {
                 return jp.getBigIntegerValue(); // should be optimal, whatever it is
             }
             return jp.getNumberValue(); // should be optimal, whatever it is
@@ -68,7 +68,7 @@
             /* [JACKSON-72]: need to allow overriding the behavior regarding
              *   which type to use
              */
-            if (ctxt.isEnabled(DeserializationConfig.Feature.USE_BIG_DECIMAL_FOR_FLOATS)) {
+            if (ctxt.isEnabled(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS)) {
                 return jp.getDecimalValue();
             }
             return Double.valueOf(jp.getDoubleValue());
@@ -110,14 +110,14 @@
 
         case VALUE_NUMBER_INT:
             // For [JACKSON-100], see above:
-            if (ctxt.isEnabled(DeserializationConfig.Feature.USE_BIG_INTEGER_FOR_INTS)) {
+            if (ctxt.isEnabled(DeserializationFeature.USE_BIG_INTEGER_FOR_INTS)) {
                 return jp.getBigIntegerValue();
             }
             return jp.getIntValue();
 
         case VALUE_NUMBER_FLOAT:
             // For [JACKSON-72], see above
-            if (ctxt.isEnabled(DeserializationConfig.Feature.USE_BIG_DECIMAL_FOR_FLOATS)) {
+            if (ctxt.isEnabled(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS)) {
                 return jp.getDecimalValue();
             }
             return Double.valueOf(jp.getDoubleValue());
@@ -147,7 +147,7 @@
     protected Object mapArray(JsonParser jp, DeserializationContext ctxt)
         throws IOException, JsonProcessingException
     {
-        if (ctxt.isEnabled(DeserializationConfig.Feature.USE_JAVA_ARRAY_FOR_JSON_ARRAY)) {
+        if (ctxt.isEnabled(DeserializationFeature.USE_JAVA_ARRAY_FOR_JSON_ARRAY)) {
             return mapArrayToArray(jp, ctxt);
         }
         // Minor optimization to handle small lists (default size for ArrayList is 10)
diff --git a/src/main/java/com/fasterxml/jackson/databind/ext/JodaSerializers.java b/src/main/java/com/fasterxml/jackson/databind/ext/JodaSerializers.java
index 5ba7822..648e7af 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ext/JodaSerializers.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ext/JodaSerializers.java
@@ -89,7 +89,7 @@
         public void serialize(DateTime value, JsonGenerator jgen, SerializerProvider provider)
             throws IOException, JsonGenerationException
         {
-            if (provider.isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS)) {
+            if (provider.isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)) {
                 jgen.writeNumber(value.getMillis());
             } else {
                 jgen.writeString(value.toString());
@@ -99,7 +99,7 @@
         @Override
         public JsonNode getSchema(SerializerProvider provider, java.lang.reflect.Type typeHint)
         {
-            return createSchemaNode(provider.isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS)
+            return createSchemaNode(provider.isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
                     ? "number" : "string", true);
         }
     }
@@ -113,7 +113,7 @@
         public void serialize(LocalDateTime dt, JsonGenerator jgen, SerializerProvider provider)
             throws IOException, JsonGenerationException
         {
-            if (provider.isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS)) {
+            if (provider.isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)) {
                 // Timestamp here actually means an array of values
                 jgen.writeStartArray();
                 jgen.writeNumber(dt.year().get());
@@ -132,7 +132,7 @@
         @Override
         public JsonNode getSchema(SerializerProvider provider, java.lang.reflect.Type typeHint)
         {
-            return createSchemaNode(provider.isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS)
+            return createSchemaNode(provider.isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
                     ? "array" : "string", true);
         }
     }
@@ -146,7 +146,7 @@
         public void serialize(LocalDate dt, JsonGenerator jgen, SerializerProvider provider)
             throws IOException, JsonGenerationException
         {
-            if (provider.isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS)) {
+            if (provider.isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)) {
                 // Timestamp here actually means an array of values
                 jgen.writeStartArray();
                 jgen.writeNumber(dt.year().get());
@@ -161,7 +161,7 @@
         @Override
         public JsonNode getSchema(SerializerProvider provider, java.lang.reflect.Type typeHint)
         {
-            return createSchemaNode(provider.isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS)
+            return createSchemaNode(provider.isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
                     ? "array" : "string", true);
         }
     }
@@ -175,7 +175,7 @@
         public void serialize(DateMidnight dt, JsonGenerator jgen, SerializerProvider provider)
             throws IOException, JsonGenerationException
         {
-            if (provider.isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS)) {
+            if (provider.isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)) {
                 // same as with other date-only values
                 jgen.writeStartArray();
                 jgen.writeNumber(dt.year().get());
@@ -190,7 +190,7 @@
         @Override
         public JsonNode getSchema(SerializerProvider provider, java.lang.reflect.Type typeHint)
         {
-            return createSchemaNode(provider.isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS)
+            return createSchemaNode(provider.isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
                     ? "array" : "string", true);
         }
     }
diff --git a/src/main/java/com/fasterxml/jackson/databind/ext/OptionalHandlerFactory.java b/src/main/java/com/fasterxml/jackson/databind/ext/OptionalHandlerFactory.java
index e373d26..89f7dfe 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ext/OptionalHandlerFactory.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ext/OptionalHandlerFactory.java
@@ -4,6 +4,8 @@
 import java.util.Map;
 
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
 import com.fasterxml.jackson.databind.util.Provider;
 
diff --git a/src/main/java/com/fasterxml/jackson/databind/introspect/BasicClassIntrospector.java b/src/main/java/com/fasterxml/jackson/databind/introspect/BasicClassIntrospector.java
index 5b32333..03d210f 100644
--- a/src/main/java/com/fasterxml/jackson/databind/introspect/BasicClassIntrospector.java
+++ b/src/main/java/com/fasterxml/jackson/databind/introspect/BasicClassIntrospector.java
@@ -1,10 +1,10 @@
 package com.fasterxml.jackson.databind.introspect;
 
 import com.fasterxml.jackson.databind.AnnotationIntrospector;
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.JavaType;
-import com.fasterxml.jackson.databind.SerializationConfig;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.type.SimpleType;
 
 public class BasicClassIntrospector
diff --git a/src/main/java/com/fasterxml/jackson/databind/introspect/ClassIntrospector.java b/src/main/java/com/fasterxml/jackson/databind/introspect/ClassIntrospector.java
index a54d5fb..51fe2c9 100644
--- a/src/main/java/com/fasterxml/jackson/databind/introspect/ClassIntrospector.java
+++ b/src/main/java/com/fasterxml/jackson/databind/introspect/ClassIntrospector.java
@@ -1,10 +1,10 @@
 package com.fasterxml.jackson.databind.introspect;
 
 import com.fasterxml.jackson.databind.BeanDescription;
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.JavaType;
-import com.fasterxml.jackson.databind.SerializationConfig;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 
 
 /**
diff --git a/src/main/java/com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.java b/src/main/java/com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.java
index 8ef2832..e110208 100644
--- a/src/main/java/com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.java
+++ b/src/main/java/com/fasterxml/jackson/databind/introspect/JacksonAnnotationIntrospector.java
@@ -9,6 +9,7 @@
 import com.fasterxml.jackson.core.Version;
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.databind.annotation.*;
+import com.fasterxml.jackson.databind.cfg.DatabindVersion;
 import com.fasterxml.jackson.databind.cfg.MapperConfig;
 import com.fasterxml.jackson.databind.jsontype.NamedType;
 import com.fasterxml.jackson.databind.jsontype.TypeIdResolver;
diff --git a/src/main/java/com/fasterxml/jackson/databind/introspect/NopAnnotationIntrospector.java b/src/main/java/com/fasterxml/jackson/databind/introspect/NopAnnotationIntrospector.java
index 7697edf..2a9cd8e 100644
--- a/src/main/java/com/fasterxml/jackson/databind/introspect/NopAnnotationIntrospector.java
+++ b/src/main/java/com/fasterxml/jackson/databind/introspect/NopAnnotationIntrospector.java
@@ -2,6 +2,7 @@
 
 import com.fasterxml.jackson.core.Version;
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.DatabindVersion;
 
 /**
  * Dummy, "no-operation" implementation of {@link AnnotationIntrospector}.
diff --git a/src/main/java/com/fasterxml/jackson/databind/jsontype/TypeResolverBuilder.java b/src/main/java/com/fasterxml/jackson/databind/jsontype/TypeResolverBuilder.java
index 58a801b..cefd909 100644
--- a/src/main/java/com/fasterxml/jackson/databind/jsontype/TypeResolverBuilder.java
+++ b/src/main/java/com/fasterxml/jackson/databind/jsontype/TypeResolverBuilder.java
@@ -4,9 +4,9 @@
 
 import com.fasterxml.jackson.annotation.JsonTypeInfo;
 import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.JavaType;
-import com.fasterxml.jackson.databind.SerializationConfig;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 
 /**
  * Interface that defines builders that are configured based on
diff --git a/src/main/java/com/fasterxml/jackson/databind/jsontype/impl/StdTypeResolverBuilder.java b/src/main/java/com/fasterxml/jackson/databind/jsontype/impl/StdTypeResolverBuilder.java
index 1d51a13..4eacf30 100644
--- a/src/main/java/com/fasterxml/jackson/databind/jsontype/impl/StdTypeResolverBuilder.java
+++ b/src/main/java/com/fasterxml/jackson/databind/jsontype/impl/StdTypeResolverBuilder.java
@@ -4,7 +4,9 @@
 
 import com.fasterxml.jackson.annotation.JsonTypeInfo;
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.jsontype.NamedType;
 import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
 import com.fasterxml.jackson.databind.jsontype.TypeIdResolver;
diff --git a/src/main/java/com/fasterxml/jackson/databind/module/SimpleAbstractTypeResolver.java b/src/main/java/com/fasterxml/jackson/databind/module/SimpleAbstractTypeResolver.java
index e564e9d..fe7627c 100644
--- a/src/main/java/com/fasterxml/jackson/databind/module/SimpleAbstractTypeResolver.java
+++ b/src/main/java/com/fasterxml/jackson/databind/module/SimpleAbstractTypeResolver.java
@@ -5,8 +5,8 @@
 
 
 import com.fasterxml.jackson.databind.AbstractTypeResolver;
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.type.ClassKey;
 
 /**
diff --git a/src/main/java/com/fasterxml/jackson/databind/module/SimpleDeserializers.java b/src/main/java/com/fasterxml/jackson/databind/module/SimpleDeserializers.java
index 9448ec6..0c524ff 100644
--- a/src/main/java/com/fasterxml/jackson/databind/module/SimpleDeserializers.java
+++ b/src/main/java/com/fasterxml/jackson/databind/module/SimpleDeserializers.java
@@ -3,6 +3,7 @@
 import java.util.*;
 
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.deser.Deserializers;
 import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
 import com.fasterxml.jackson.databind.type.*;
diff --git a/src/main/java/com/fasterxml/jackson/databind/module/SimpleKeyDeserializers.java b/src/main/java/com/fasterxml/jackson/databind/module/SimpleKeyDeserializers.java
index 8bc32c4..4523900 100644
--- a/src/main/java/com/fasterxml/jackson/databind/module/SimpleKeyDeserializers.java
+++ b/src/main/java/com/fasterxml/jackson/databind/module/SimpleKeyDeserializers.java
@@ -6,6 +6,7 @@
 
 
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.deser.KeyDeserializers;
 import com.fasterxml.jackson.databind.type.ClassKey;
 
diff --git a/src/main/java/com/fasterxml/jackson/databind/module/SimpleSerializers.java b/src/main/java/com/fasterxml/jackson/databind/module/SimpleSerializers.java
index b844c92..19b1489 100644
--- a/src/main/java/com/fasterxml/jackson/databind/module/SimpleSerializers.java
+++ b/src/main/java/com/fasterxml/jackson/databind/module/SimpleSerializers.java
@@ -4,6 +4,7 @@
 
 
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
 import com.fasterxml.jackson.databind.ser.Serializers;
 import com.fasterxml.jackson.databind.type.ArrayType;
diff --git a/src/main/java/com/fasterxml/jackson/databind/module/SimpleValueInstantiators.java b/src/main/java/com/fasterxml/jackson/databind/module/SimpleValueInstantiators.java
index d53acd3..af2f208 100644
--- a/src/main/java/com/fasterxml/jackson/databind/module/SimpleValueInstantiators.java
+++ b/src/main/java/com/fasterxml/jackson/databind/module/SimpleValueInstantiators.java
@@ -3,7 +3,7 @@
 import java.util.HashMap;
 
 import com.fasterxml.jackson.databind.BeanDescription;
-import com.fasterxml.jackson.databind.DeserializationConfig;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.deser.ValueInstantiator;
 import com.fasterxml.jackson.databind.deser.ValueInstantiators;
 import com.fasterxml.jackson.databind.type.ClassKey;
diff --git a/src/main/java/com/fasterxml/jackson/databind/node/TreeTraversingParser.java b/src/main/java/com/fasterxml/jackson/databind/node/TreeTraversingParser.java
index ec3c15d..8e34ce7 100644
--- a/src/main/java/com/fasterxml/jackson/databind/node/TreeTraversingParser.java
+++ b/src/main/java/com/fasterxml/jackson/databind/node/TreeTraversingParser.java
@@ -7,8 +7,8 @@
 import com.fasterxml.jackson.core.*;
 import com.fasterxml.jackson.core.base.ParserMinimalBase;
 
-import com.fasterxml.jackson.databind.DatabindVersion;
 import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.cfg.DatabindVersion;
 
 /**
  * Facade over {@link JsonNode} that implements {@link JsonParser} to allow
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/BasicSerializerFactory.java b/src/main/java/com/fasterxml/jackson/databind/ser/BasicSerializerFactory.java
index 8afb1b1..c6e4ae1 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/BasicSerializerFactory.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/BasicSerializerFactory.java
@@ -9,7 +9,7 @@
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.annotation.NoClass;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.cfg.SerializerFactoryConfig;
 import com.fasterxml.jackson.databind.ext.OptionalHandlerFactory;
 import com.fasterxml.jackson.databind.introspect.*;
@@ -750,7 +750,7 @@
                 return true;
             }
         } else {
-            if (config.isEnabled(MapperConfig.Feature.USE_STATIC_TYPING)) {
+            if (config.isEnabled(MapperFeature.USE_STATIC_TYPING)) {
                 return true;
             }
         }
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/BeanSerializerFactory.java b/src/main/java/com/fasterxml/jackson/databind/ser/BeanSerializerFactory.java
index 8e406d0..aad1555 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/BeanSerializerFactory.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/BeanSerializerFactory.java
@@ -3,7 +3,7 @@
 import java.util.*;
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.cfg.SerializerFactoryConfig;
 import com.fasterxml.jackson.databind.introspect.*;
 import com.fasterxml.jackson.databind.jsontype.NamedType;
@@ -309,7 +309,7 @@
             }
             JavaType type = anyGetter.getType(beanDesc.bindingsForBeanType());
             // copied from BasicSerializerFactory.buildMapSerializer():
-            boolean staticTyping = config.isEnabled(MapperConfig.Feature.USE_STATIC_TYPING);
+            boolean staticTyping = config.isEnabled(MapperFeature.USE_STATIC_TYPING);
             JavaType valueType = type.getContentType();
             TypeSerializer typeSer = createTypeSerializer(config, valueType);
             // last 2 nulls; don't know key, value serializers (yet)
@@ -408,7 +408,7 @@
         removeIgnorableTypes(config, beanDesc, properties);
         
         // and possibly remove ones without matching mutator...
-        if (config.isEnabled(MapperConfig.Feature.REQUIRE_SETTERS_FOR_GETTERS)) {
+        if (config.isEnabled(MapperFeature.REQUIRE_SETTERS_FOR_GETTERS)) {
             removeSetterlessGetters(config, beanDesc, properties);
         }
         
@@ -480,7 +480,7 @@
     {
         // [JACKSON-232]: whether non-annotated fields are included by default or not is configurable
         List<BeanPropertyWriter> props = builder.getProperties();
-        boolean includeByDefault = config.isEnabled(MapperConfig.Feature.DEFAULT_VIEW_INCLUSION);
+        boolean includeByDefault = config.isEnabled(MapperFeature.DEFAULT_VIEW_INCLUSION);
         final int propCount = props.size();
         int viewsFound = 0;
         BeanPropertyWriter[] filtered = new BeanPropertyWriter[propCount];
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/BeanSerializerModifier.java b/src/main/java/com/fasterxml/jackson/databind/ser/BeanSerializerModifier.java
index a0dc468..ed1115e 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/BeanSerializerModifier.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/BeanSerializerModifier.java
@@ -4,7 +4,7 @@
 
 import com.fasterxml.jackson.databind.BeanDescription;
 import com.fasterxml.jackson.databind.JsonSerializer;
-import com.fasterxml.jackson.databind.SerializationConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 
 /**
  * Abstract class that defines API for objects that can be registered (for {@link BeanSerializerFactory}
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/PropertyBuilder.java b/src/main/java/com/fasterxml/jackson/databind/ser/PropertyBuilder.java
index 37e3798..0cd9743 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/PropertyBuilder.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/PropertyBuilder.java
@@ -4,6 +4,7 @@
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize.Inclusion;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.introspect.*;
 import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
 import com.fasterxml.jackson.databind.util.*;
@@ -113,7 +114,7 @@
             case ALWAYS: // default
                 // we may still want to suppress empty collections, as per [JACKSON-254]:
                 if (declaredType.isContainerType()
-                        && !_config.isEnabled(SerializationConfig.Feature.WRITE_EMPTY_JSON_ARRAYS)) {
+                        && !_config.isEnabled(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS)) {
                     valueToSuppress = BeanPropertyWriter.MARKER_FOR_EMPTY;
                 }
                 break;
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/SerializerFactory.java b/src/main/java/com/fasterxml/jackson/databind/ser/SerializerFactory.java
index e6f331d..222e5f6 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/SerializerFactory.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/SerializerFactory.java
@@ -1,6 +1,7 @@
 package com.fasterxml.jackson.databind.ser;
 
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
 
 /**
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/Serializers.java b/src/main/java/com/fasterxml/jackson/databind/ser/Serializers.java
index 5246b87..3e6fa35 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/Serializers.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/Serializers.java
@@ -1,7 +1,7 @@
 package com.fasterxml.jackson.databind.ser;
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.SerializationConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
 import com.fasterxml.jackson.databind.type.*;
 
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/impl/UnknownSerializer.java b/src/main/java/com/fasterxml/jackson/databind/ser/impl/UnknownSerializer.java
index 12b7832..392d09a 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/impl/UnknownSerializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/impl/UnknownSerializer.java
@@ -21,7 +21,7 @@
         throws IOException, JsonMappingException
     {
         // 27-Nov-2009, tatu: As per [JACKSON-201] may or may not fail...
-        if (provider.isEnabled(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS)) {
+        if (provider.isEnabled(SerializationFeature.FAIL_ON_EMPTY_BEANS)) {
             failForEmpty(value);
         }
         // But if it's fine, we'll just output empty JSON Object:
@@ -34,7 +34,7 @@
             TypeSerializer typeSer)
         throws IOException, JsonGenerationException
     {
-        if (provider.isEnabled(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS)) {
+        if (provider.isEnabled(SerializationFeature.FAIL_ON_EMPTY_BEANS)) {
             failForEmpty(value);
         }
         typeSer.writeTypePrefixForObject(value, jgen);
@@ -48,6 +48,6 @@
 
     protected void failForEmpty(Object value) throws JsonMappingException
     {
-        throw new JsonMappingException("No serializer found for class "+value.getClass().getName()+" and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS) )");
+        throw new JsonMappingException("No serializer found for class "+value.getClass().getName()+" and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.SerializationFeature.FAIL_ON_EMPTY_BEANS) )");
     }
 }
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/std/CalendarSerializer.java b/src/main/java/com/fasterxml/jackson/databind/ser/std/CalendarSerializer.java
index 959cb25..1e11520 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/std/CalendarSerializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/std/CalendarSerializer.java
@@ -7,7 +7,7 @@
 import com.fasterxml.jackson.core.*;
 
 import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.SerializationConfig;
+import com.fasterxml.jackson.databind.SerializationFeature;
 import com.fasterxml.jackson.databind.SerializerProvider;
 import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
 
@@ -41,7 +41,7 @@
     public JsonNode getSchema(SerializerProvider provider, Type typeHint)
     {
         //TODO: (ryan) add a format for the date in the schema?
-        return createSchemaNode(provider.isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS)
+        return createSchemaNode(provider.isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
                 ? "number" : "string", true);
     }
 }
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/std/DateSerializer.java b/src/main/java/com/fasterxml/jackson/databind/ser/std/DateSerializer.java
index a7f6133..3fc14b0 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/std/DateSerializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/std/DateSerializer.java
@@ -7,7 +7,7 @@
 import com.fasterxml.jackson.core.*;
 
 import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.SerializationConfig;
+import com.fasterxml.jackson.databind.SerializationFeature;
 import com.fasterxml.jackson.databind.SerializerProvider;
 import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
 
@@ -40,7 +40,7 @@
     public JsonNode getSchema(SerializerProvider provider, Type typeHint)
     {
         //todo: (ryan) add a format for the date in the schema?
-        return createSchemaNode(provider.isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS)
+        return createSchemaNode(provider.isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
                 ? "number" : "string", true);
     }
 }
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/std/EnumSerializer.java b/src/main/java/com/fasterxml/jackson/databind/ser/std/EnumSerializer.java
index 5642ccc..734be0c 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/std/EnumSerializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/std/EnumSerializer.java
@@ -9,6 +9,7 @@
 
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.fasterxml.jackson.databind.util.EnumValues;
@@ -42,7 +43,7 @@
     {
         // [JACKSON-212]: If toString() is to be used instead, leave EnumValues null
         AnnotationIntrospector intr = config.getAnnotationIntrospector();
-        EnumValues v = config.isEnabled(SerializationConfig.Feature.WRITE_ENUMS_USING_TO_STRING)
+        EnumValues v = config.isEnabled(SerializationFeature.WRITE_ENUMS_USING_TO_STRING)
             ? EnumValues.constructFromToString(enumClass, intr) : EnumValues.constructFromName(enumClass, intr);
         return new EnumSerializer(v);
     }
@@ -52,7 +53,7 @@
         throws IOException, JsonGenerationException
     {
         // [JACKSON-684]: serialize as index?
-        if (provider.isEnabled(SerializationConfig.Feature.WRITE_ENUMS_USING_INDEX)) {
+        if (provider.isEnabled(SerializationFeature.WRITE_ENUMS_USING_INDEX)) {
             jgen.writeNumber(en.ordinal());
             return;
         }
@@ -63,7 +64,7 @@
     public JsonNode getSchema(SerializerProvider provider, Type typeHint)
     {
         // [JACKSON-684]: serialize as index?
-        if (provider.isEnabled(SerializationConfig.Feature.WRITE_ENUMS_USING_INDEX)) {
+        if (provider.isEnabled(SerializationFeature.WRITE_ENUMS_USING_INDEX)) {
             return createSchemaNode("integer", true);
         }
         ObjectNode objectNode = createSchemaNode("string", true);
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/std/JsonValueSerializer.java b/src/main/java/com/fasterxml/jackson/databind/ser/std/JsonValueSerializer.java
index 59aaedc..5634f1f 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/std/JsonValueSerializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/std/JsonValueSerializer.java
@@ -10,7 +10,6 @@
 
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 import com.fasterxml.jackson.databind.jsonschema.JsonSchema;
 import com.fasterxml.jackson.databind.jsonschema.SchemaAware;
 import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
@@ -111,7 +110,7 @@
              * if not, we don't really know the actual type until we get the instance.
              */
             // 10-Mar-2010, tatu: Except if static typing is to be used
-            if (provider.isEnabled(MapperConfig.Feature.USE_STATIC_TYPING)
+            if (provider.isEnabled(MapperFeature.USE_STATIC_TYPING)
                     || Modifier.isFinal(_accessorMethod.getReturnType().getModifiers())) {
                 JavaType t = provider.constructType(_accessorMethod.getGenericReturnType());
                 // false -> no need to cache
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/std/MapSerializer.java b/src/main/java/com/fasterxml/jackson/databind/ser/std/MapSerializer.java
index a15bbe9..27ee6f0 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/std/MapSerializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/std/MapSerializer.java
@@ -287,7 +287,7 @@
         final JsonSerializer<Object> keySerializer = _keySerializer;
         
         final HashSet<String> ignored = _ignoredEntries;
-        final boolean skipNulls = !provider.isEnabled(SerializationConfig.Feature.WRITE_NULL_MAP_VALUES);
+        final boolean skipNulls = !provider.isEnabled(SerializationFeature.WRITE_NULL_MAP_VALUES);
 
         PropertySerializerMap serializers = _dynamicValueSerializers;
 
@@ -343,7 +343,7 @@
         final JsonSerializer<Object> keySerializer = _keySerializer;
         final HashSet<String> ignored = _ignoredEntries;
         final TypeSerializer typeSer = _valueTypeSerializer;
-        final boolean skipNulls = !provider.isEnabled(SerializationConfig.Feature.WRITE_NULL_MAP_VALUES);
+        final boolean skipNulls = !provider.isEnabled(SerializationFeature.WRITE_NULL_MAP_VALUES);
 
         for (Map.Entry<?,?> entry : value.entrySet()) {
             Object valueElem = entry.getValue();
@@ -381,7 +381,7 @@
         JsonSerializer<Object> prevValueSerializer = null;
         Class<?> prevValueClass = null;
         final HashSet<String> ignored = _ignoredEntries;
-        final boolean skipNulls = !provider.isEnabled(SerializationConfig.Feature.WRITE_NULL_MAP_VALUES);
+        final boolean skipNulls = !provider.isEnabled(SerializationFeature.WRITE_NULL_MAP_VALUES);
     
         for (Map.Entry<?,?> entry : value.entrySet()) {
             Object valueElem = entry.getValue();
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/std/StdArraySerializers.java b/src/main/java/com/fasterxml/jackson/databind/ser/std/StdArraySerializers.java
index 9199483..49ce211 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/std/StdArraySerializers.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/std/StdArraySerializers.java
@@ -239,7 +239,7 @@
             throws IOException, JsonGenerationException
         {
             // [JACKSON-289] allows serializing as 'sparse' char array too:
-            if (provider.isEnabled(SerializationConfig.Feature.WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS)) {
+            if (provider.isEnabled(SerializationFeature.WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS)) {
                 jgen.writeStartArray();
                 _writeArrayContents(jgen, value);
                 jgen.writeEndArray();
@@ -254,7 +254,7 @@
             throws IOException, JsonGenerationException
         {
             // [JACKSON-289] allows serializing as 'sparse' char array too:
-            if (provider.isEnabled(SerializationConfig.Feature.WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS)) {
+            if (provider.isEnabled(SerializationFeature.WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS)) {
                 typeSer.writeTypePrefixForArray(value, jgen);
                 _writeArrayContents(jgen, value);
                 typeSer.writeTypeSuffixForArray(value, jgen);
diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/std/StdSerializer.java b/src/main/java/com/fasterxml/jackson/databind/ser/std/StdSerializer.java
index 3854d83..77d4911 100644
--- a/src/main/java/com/fasterxml/jackson/databind/ser/std/StdSerializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/ser/std/StdSerializer.java
@@ -141,7 +141,7 @@
             throw (Error) t;
         }
         // Ditto for IOExceptions... except for mapping exceptions!
-        boolean wrap = (provider == null) || provider.isEnabled(SerializationConfig.Feature.WRAP_EXCEPTIONS);
+        boolean wrap = (provider == null) || provider.isEnabled(SerializationFeature.WRAP_EXCEPTIONS);
         if (t instanceof IOException) {
             if (!wrap || !(t instanceof JsonMappingException)) {
                 throw (IOException) t;
@@ -167,7 +167,7 @@
             throw (Error) t;
         }
         // Ditto for IOExceptions... except for mapping exceptions!
-        boolean wrap = (provider == null) || provider.isEnabled(SerializationConfig.Feature.WRAP_EXCEPTIONS);
+        boolean wrap = (provider == null) || provider.isEnabled(SerializationFeature.WRAP_EXCEPTIONS);
         if (t instanceof IOException) {
             if (!wrap || !(t instanceof JsonMappingException)) {
                 throw (IOException) t;
diff --git a/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java b/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java
index c5b4680..17b9160 100644
--- a/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java
+++ b/src/main/java/com/fasterxml/jackson/databind/type/TypeFactory.java
@@ -15,8 +15,8 @@
  *<p>
  * Instances of this class are accessible using {@link com.fasterxml.jackson.databind.ObjectMapper}
  * as well as many objects it constructs (like
-* {@link com.fasterxml.jackson.databind.DeserializationConfig} and
- * {@link com.fasterxml.jackson.databind.SerializationConfig})),
+* {@link com.fasterxml.jackson.databind.cfg.DeserializationConfig} and
+ * {@link com.fasterxml.jackson.databind.cfg.SerializationConfig})),
  * but usually those objects also 
  * expose convenience methods (<code>constructType</code>).
  * So, you can do for example:
diff --git a/src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java b/src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java
index ec09470..f788fe8 100644
--- a/src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/util/TokenBuffer.java
@@ -10,7 +10,7 @@
 import com.fasterxml.jackson.core.json.JsonWriteContext;
 import com.fasterxml.jackson.core.util.ByteArrayBuilder;
 
-import com.fasterxml.jackson.databind.DatabindVersion;
+import com.fasterxml.jackson.databind.cfg.DatabindVersion;
 
 /**
  * Utility class used for efficient storage of {@link JsonToken}
@@ -328,7 +328,7 @@
         return this;
     }
 
-    //public JsonGenerator configure(Feature f, boolean state) { }
+    //public JsonGenerator configure(SerializationFeature f, boolean state) { }
 
     @Override
     public boolean isEnabled(Feature f) {
diff --git a/src/main/resources/com/fasterxml/jackson/databind/VERSION.txt b/src/main/resources/com/fasterxml/jackson/databind/cfg/VERSION.txt
similarity index 100%
rename from src/main/resources/com/fasterxml/jackson/databind/VERSION.txt
rename to src/main/resources/com/fasterxml/jackson/databind/cfg/VERSION.txt
diff --git a/src/test/java/com/fasterxml/jackson/databind/TestHandlerInstantiation.java b/src/test/java/com/fasterxml/jackson/databind/TestHandlerInstantiation.java
index 5458ea3..c6fc826 100644
--- a/src/test/java/com/fasterxml/jackson/databind/TestHandlerInstantiation.java
+++ b/src/test/java/com/fasterxml/jackson/databind/TestHandlerInstantiation.java
@@ -8,17 +8,17 @@
 import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
 
 import com.fasterxml.jackson.core.*;
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.HandlerInstantiator;
 import com.fasterxml.jackson.databind.JsonDeserializer;
 import com.fasterxml.jackson.databind.JsonSerializer;
 import com.fasterxml.jackson.databind.KeyDeserializer;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationConfig;
 import com.fasterxml.jackson.databind.SerializerProvider;
 import com.fasterxml.jackson.databind.annotation.*;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
+import com.fasterxml.jackson.databind.cfg.HandlerInstantiator;
 import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.introspect.Annotated;
 import com.fasterxml.jackson.databind.jsontype.TypeIdResolver;
 import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder;
diff --git a/src/test/java/com/fasterxml/jackson/databind/TestNamingStrategy.java b/src/test/java/com/fasterxml/jackson/databind/TestNamingStrategy.java
index 6d5db41..3e47a08 100644
--- a/src/test/java/com/fasterxml/jackson/databind/TestNamingStrategy.java
+++ b/src/test/java/com/fasterxml/jackson/databind/TestNamingStrategy.java
@@ -222,7 +222,7 @@
     {
         ObjectMapper mapper = new ObjectMapper();
         mapper.setPropertyNamingStrategy(new LcStrategy());
-//        mapper.disable(DeserializationConfig.Feature.USE_GETTERS_AS_SETTERS);
+//        mapper.disable(DeserializationConfig.DeserializationFeature.USE_GETTERS_AS_SETTERS);
         RenamedCollectionBean foo = mapper.readValue("{\"thevalues\":[\"a\"]}", RenamedCollectionBean.class);
         assertNotNull(foo.getTheVALUEs());
         assertEquals(1, foo.getTheVALUEs().size());
diff --git a/src/test/java/com/fasterxml/jackson/databind/TestObjectMapper.java b/src/test/java/com/fasterxml/jackson/databind/TestObjectMapper.java
index ea2b016..02e20d4 100644
--- a/src/test/java/com/fasterxml/jackson/databind/TestObjectMapper.java
+++ b/src/test/java/com/fasterxml/jackson/databind/TestObjectMapper.java
@@ -4,10 +4,9 @@
 
 import com.fasterxml.jackson.core.JsonFactory;
 
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationConfig;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.node.*;
 import com.fasterxml.jackson.databind.type.TypeFactory;
 
@@ -57,21 +56,21 @@
         ObjectMapper m = new ObjectMapper();
         
         // sort-alphabetically is disabled by default:
-        assertFalse(m.isEnabled(MapperConfig.Feature.SORT_PROPERTIES_ALPHABETICALLY));
+        assertFalse(m.isEnabled(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY));
         SerializationConfig sc = m.getSerializationConfig();
-        assertFalse(sc.isEnabled(MapperConfig.Feature.SORT_PROPERTIES_ALPHABETICALLY));
+        assertFalse(sc.isEnabled(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY));
         assertFalse(sc.shouldSortPropertiesAlphabetically());
         DeserializationConfig dc = m.getDeserializationConfig();
         assertFalse(dc.shouldSortPropertiesAlphabetically());
 
         // but when enabled, should be visible:
-        m.enable(MapperConfig.Feature.SORT_PROPERTIES_ALPHABETICALLY);
+        m.enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY);
         sc = m.getSerializationConfig();
-        assertTrue(sc.isEnabled(MapperConfig.Feature.SORT_PROPERTIES_ALPHABETICALLY));
+        assertTrue(sc.isEnabled(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY));
         assertTrue(sc.shouldSortPropertiesAlphabetically());
         dc = m.getDeserializationConfig();
         // and not just via SerializationConfig, but also via DeserializationConfig
-        assertTrue(dc.isEnabled(MapperConfig.Feature.SORT_PROPERTIES_ALPHABETICALLY));
+        assertTrue(dc.isEnabled(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY));
         assertTrue(dc.shouldSortPropertiesAlphabetically());
     }
 
diff --git a/src/test/java/com/fasterxml/jackson/databind/TestRootName.java b/src/test/java/com/fasterxml/jackson/databind/TestRootName.java
index 906e41a..87e096b 100644
--- a/src/test/java/com/fasterxml/jackson/databind/TestRootName.java
+++ b/src/test/java/com/fasterxml/jackson/databind/TestRootName.java
@@ -2,9 +2,7 @@
 
 import com.fasterxml.jackson.annotation.*;
 
-import com.fasterxml.jackson.databind.DeserializationConfig;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationConfig;
 
 /**
  * Unit tests dealing with handling of "root element wrapping",
@@ -49,7 +47,7 @@
         String jsonUnwrapped = mapper.writeValueAsString(input);
         assertEquals("{\"a\":3}", jsonUnwrapped);
         // secondary: wrapping
-        String jsonWrapped = mapper.writer(SerializationConfig.Feature.WRAP_ROOT_VALUE)
+        String jsonWrapped = mapper.writer(SerializationFeature.WRAP_ROOT_VALUE)
             .writeValueAsString(input);
         assertEquals("{\"rudy\":{\"a\":3}}", jsonWrapped);
 
@@ -57,14 +55,14 @@
         Bean result = mapper.readValue(jsonUnwrapped, Bean.class);
         assertNotNull(result);
         try { // must not have extra wrapping
-            result = mapper.reader(Bean.class).with(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE)
+            result = mapper.reader(Bean.class).with(DeserializationFeature.UNWRAP_ROOT_VALUE)
                 .readValue(jsonUnwrapped);
             fail("Should have failed");
         } catch (JsonMappingException e) {
             verifyException(e, "Root name 'a'");
         }
         // except wrapping may be expected:
-        result = mapper.reader(Bean.class).with(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE)
+        result = mapper.reader(Bean.class).with(DeserializationFeature.UNWRAP_ROOT_VALUE)
             .readValue(jsonWrapped);
         assertNotNull(result);
     }
@@ -81,7 +79,7 @@
         Bean bean = reader.readValue(json);
         assertNotNull(bean);
 
-        // also: verify that we can override Feature as well:
+        // also: verify that we can override SerializationFeature as well:
         ObjectMapper wrapping = rootMapper();
         json = wrapping.writer().withRootName("something").writeValueAsString(new Bean());
         assertEquals("{\"something\":{\"a\":3}}", json);
@@ -101,8 +99,8 @@
     private ObjectMapper rootMapper()
     {
         ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
-        mapper.configure(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE, true);
+        mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
+        mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
         return mapper;
     }
 }
diff --git a/src/test/java/com/fasterxml/jackson/databind/convert/TestBeanConversions.java b/src/test/java/com/fasterxml/jackson/databind/convert/TestBeanConversions.java
index eedb723..85fcc67 100644
--- a/src/test/java/com/fasterxml/jackson/databind/convert/TestBeanConversions.java
+++ b/src/test/java/com/fasterxml/jackson/databind/convert/TestBeanConversions.java
@@ -101,8 +101,8 @@
     public void testWrapping() throws Exception
     {
         ObjectMapper wrappingMapper = new ObjectMapper();
-        wrappingMapper.enable(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE);
-        wrappingMapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE);
+        wrappingMapper.enable(DeserializationFeature.UNWRAP_ROOT_VALUE);
+        wrappingMapper.enable(SerializationFeature.WRAP_ROOT_VALUE);
 
         // conversion is ok, even if it's bogus one
         _convertAndVerifyPoint(wrappingMapper);
@@ -110,13 +110,13 @@
         // also: ok to have mismatched settings, since as per [JACKSON-710], should
         // not actually use wrapping internally in these cases
         wrappingMapper = new ObjectMapper();
-        wrappingMapper.enable(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE);
-        wrappingMapper.disable(SerializationConfig.Feature.WRAP_ROOT_VALUE);
+        wrappingMapper.enable(DeserializationFeature.UNWRAP_ROOT_VALUE);
+        wrappingMapper.disable(SerializationFeature.WRAP_ROOT_VALUE);
         _convertAndVerifyPoint(wrappingMapper);
 
         wrappingMapper = new ObjectMapper();
-        wrappingMapper.disable(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE);
-        wrappingMapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE);
+        wrappingMapper.disable(DeserializationFeature.UNWRAP_ROOT_VALUE);
+        wrappingMapper.enable(SerializationFeature.WRAP_ROOT_VALUE);
         _convertAndVerifyPoint(wrappingMapper);
     }
 
diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/TestAnyProperties.java b/src/test/java/com/fasterxml/jackson/databind/deser/TestAnyProperties.java
index 34a1aa4..3c02b12 100644
--- a/src/test/java/com/fasterxml/jackson/databind/deser/TestAnyProperties.java
+++ b/src/test/java/com/fasterxml/jackson/databind/deser/TestAnyProperties.java
@@ -144,14 +144,14 @@
     public void testIgnored() throws Exception
     {
         ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(com.fasterxml.jackson.databind.DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, true);
+        mapper.configure(com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true);
         _testIgnorals(mapper);
     }
 
     public void testIgnored383() throws Exception
     {
         ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(com.fasterxml.jackson.databind.DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+        mapper.configure(com.fasterxml.jackson.databind.DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
         _testIgnorals(mapper);
     }
     
diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/TestArrayDeserialization.java b/src/test/java/com/fasterxml/jackson/databind/deser/TestArrayDeserialization.java
index 521a84d..d4672d6 100644
--- a/src/test/java/com/fasterxml/jackson/databind/deser/TestArrayDeserialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/deser/TestArrayDeserialization.java
@@ -181,7 +181,7 @@
     public void testFromEmptyString() throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.configure(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
+        m.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
         assertNull(m.readValue(quote(""), Object[].class));
         assertNull( m.readValue(quote(""), String[].class));
         assertNull( m.readValue(quote(""), int[].class));
diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/TestBeanDeserializer.java b/src/test/java/com/fasterxml/jackson/databind/deser/TestBeanDeserializer.java
index bb18938..c113e66 100644
--- a/src/test/java/com/fasterxml/jackson/databind/deser/TestBeanDeserializer.java
+++ b/src/test/java/com/fasterxml/jackson/databind/deser/TestBeanDeserializer.java
@@ -5,6 +5,7 @@
 
 import com.fasterxml.jackson.core.*;
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.deser.BeanDeserializer;
 import com.fasterxml.jackson.databind.deser.BeanDeserializerBuilder;
 import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier;
@@ -188,7 +189,7 @@
 
         // should be ok to enable dynamically:
         mapper = new ObjectMapper();
-        mapper.configure(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
+        mapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
         Bean result = mapper.readValue(quote(""), Bean.class);
         assertNull(result);
     }
diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/TestCollectionDeserialization.java b/src/test/java/com/fasterxml/jackson/databind/deser/TestCollectionDeserialization.java
index 8ecdbe9..2e466c0 100644
--- a/src/test/java/com/fasterxml/jackson/databind/deser/TestCollectionDeserialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/deser/TestCollectionDeserialization.java
@@ -114,7 +114,7 @@
     public void testImplicitArrays() throws Exception
     {
         ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
+        mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
 
         // first with simple scalar types (numbers), with collections
         List<Integer> ints = mapper.readValue("4", List.class);
@@ -146,7 +146,7 @@
     public void testFromEmptyString() throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.configure(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
+        m.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
         List<?> result = m.readValue(quote(""), List.class);
         assertNull(result);
     }
diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/TestConfig.java b/src/test/java/com/fasterxml/jackson/databind/deser/TestConfig.java
index e21d06a..6eef338 100644
--- a/src/test/java/com/fasterxml/jackson/databind/deser/TestConfig.java
+++ b/src/test/java/com/fasterxml/jackson/databind/deser/TestConfig.java
@@ -4,7 +4,7 @@
 import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 
 /**
  * Unit tests for checking handling of DeserializationConfig.
@@ -36,17 +36,17 @@
         DeserializationConfig cfg = m.getDeserializationConfig();
 
         // Expected defaults:
-        assertTrue(cfg.isEnabled(MapperConfig.Feature.USE_ANNOTATIONS));
-        assertTrue(cfg.isEnabled(MapperConfig.Feature.AUTO_DETECT_SETTERS));
-        assertTrue(cfg.isEnabled(MapperConfig.Feature.AUTO_DETECT_CREATORS));
-        assertTrue(cfg.isEnabled(MapperConfig.Feature.USE_GETTERS_AS_SETTERS));
-        assertTrue(cfg.isEnabled(MapperConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS));
+        assertTrue(cfg.isEnabled(MapperFeature.USE_ANNOTATIONS));
+        assertTrue(cfg.isEnabled(MapperFeature.AUTO_DETECT_SETTERS));
+        assertTrue(cfg.isEnabled(MapperFeature.AUTO_DETECT_CREATORS));
+        assertTrue(cfg.isEnabled(MapperFeature.USE_GETTERS_AS_SETTERS));
+        assertTrue(cfg.isEnabled(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS));
 
 
-        assertFalse(cfg.isEnabled(DeserializationConfig.Feature.USE_BIG_DECIMAL_FOR_FLOATS));
-        assertFalse(cfg.isEnabled(DeserializationConfig.Feature.USE_BIG_INTEGER_FOR_INTS));
+        assertFalse(cfg.isEnabled(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS));
+        assertFalse(cfg.isEnabled(DeserializationFeature.USE_BIG_INTEGER_FOR_INTS));
 
-        assertTrue(cfg.isEnabled(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES));
+        assertTrue(cfg.isEnabled(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES));
     }
 
     public void testOverrideIntrospectors()
@@ -63,13 +63,13 @@
     {
         // first: verify that annotation introspection is enabled by default
         ObjectMapper m = new ObjectMapper();
-        assertTrue(m.getDeserializationConfig().isEnabled(MapperConfig.Feature.USE_ANNOTATIONS));
+        assertTrue(m.getDeserializationConfig().isEnabled(MapperFeature.USE_ANNOTATIONS));
         // with annotations, property is renamed
         AnnoBean bean = m.readValue("{ \"y\" : 0 }", AnnoBean.class);
         assertEquals(0, bean.value);
 
         m = new ObjectMapper();
-        m.configure(MapperConfig.Feature.USE_ANNOTATIONS, false);
+        m.configure(MapperFeature.USE_ANNOTATIONS, false);
         // without annotations, should default to default bean-based name...
         bean = m.readValue("{ \"x\" : 0 }", AnnoBean.class);
         assertEquals(0, bean.value);
diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/TestCreators2.java b/src/test/java/com/fasterxml/jackson/databind/deser/TestCreators2.java
index d288f01..7e67f1d 100644
--- a/src/test/java/com/fasterxml/jackson/databind/deser/TestCreators2.java
+++ b/src/test/java/com/fasterxml/jackson/databind/deser/TestCreators2.java
@@ -109,7 +109,7 @@
         }
     }
     
-    // For [JACKSON-541]: should not need @JsonCreator if Feature.AUTO_DETECT_CREATORS is on.
+    // For [JACKSON-541]: should not need @JsonCreator if SerializationFeature.AUTO_DETECT_CREATORS is on.
     static class AutoDetectConstructorBean
     {
     	protected final String foo;
diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/TestEnumDeserialization.java b/src/test/java/com/fasterxml/jackson/databind/deser/TestEnumDeserialization.java
index aff52e3..2580ae5 100644
--- a/src/test/java/com/fasterxml/jackson/databind/deser/TestEnumDeserialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/deser/TestEnumDeserialization.java
@@ -161,7 +161,7 @@
     {
         // can't reuse global one due to reconfig
         ObjectMapper m = new ObjectMapper();
-        m.configure(DeserializationConfig.Feature.READ_ENUMS_USING_TO_STRING, true);
+        m.configure(DeserializationFeature.READ_ENUMS_USING_TO_STRING, true);
         LowerCaseEnum value = m.readValue("\"c\"", LowerCaseEnum.class);
         assertEquals(LowerCaseEnum.C, value);
     }
@@ -171,7 +171,7 @@
     {
         // can't reuse global one due to reconfig
         ObjectMapper m = new ObjectMapper();
-        m.configure(DeserializationConfig.Feature.READ_ENUMS_USING_TO_STRING, true);
+        m.configure(DeserializationFeature.READ_ENUMS_USING_TO_STRING, true);
         EnumMap<LowerCaseEnum,String> value = m.readValue("{\"a\":\"value\"}",
                 new TypeReference<EnumMap<LowerCaseEnum,String>>() { });
         assertEquals("value", value.get(LowerCaseEnum.A));
@@ -181,13 +181,13 @@
     public void testNumbersToEnums() throws Exception
     {
         // by default numbers are fine:
-        assertFalse(mapper.getDeserializationConfig().isEnabled(DeserializationConfig.Feature.FAIL_ON_NUMBERS_FOR_ENUMS));
+        assertFalse(mapper.getDeserializationConfig().isEnabled(DeserializationFeature.FAIL_ON_NUMBERS_FOR_ENUMS));
         TestEnum value = mapper.readValue("1", TestEnum.class);
         assertSame(TestEnum.RULES, value);
 
         // but can also be changed to errors:
         ObjectMapper m = new ObjectMapper();
-        m.configure(DeserializationConfig.Feature.FAIL_ON_NUMBERS_FOR_ENUMS, true);
+        m.configure(DeserializationFeature.FAIL_ON_NUMBERS_FOR_ENUMS, true);
         try {
             value = m.readValue("1", TestEnum.class);
             fail("Expected an error");
@@ -200,7 +200,7 @@
     public void testEnumsWithIndex() throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.enable(SerializationConfig.Feature.WRITE_ENUMS_USING_INDEX);
+        m.enable(SerializationFeature.WRITE_ENUMS_USING_INDEX);
         String json = m.writeValueAsString(TestEnum.RULES);
         assertEquals(String.valueOf(TestEnum.RULES.ordinal()), json);
         TestEnum result = m.readValue(json, TestEnum.class);
diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/TestGenericNumber.java b/src/test/java/com/fasterxml/jackson/databind/deser/TestGenericNumber.java
index 3851e25..0e90ac4 100644
--- a/src/test/java/com/fasterxml/jackson/databind/deser/TestGenericNumber.java
+++ b/src/test/java/com/fasterxml/jackson/databind/deser/TestGenericNumber.java
@@ -46,7 +46,7 @@
          * to BigInteger even if value would fit in Integer
          */
         ObjectMapper m = new ObjectMapper();
-        m.enable(DeserializationConfig.Feature.USE_BIG_INTEGER_FOR_INTS);
+        m.enable(DeserializationFeature.USE_BIG_INTEGER_FOR_INTS);
         BigInteger exp = BigInteger.valueOf(123L);
 
         // first test as any Number
@@ -76,7 +76,7 @@
     public void testFpTypeOverrideSimple() throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.enable(DeserializationConfig.Feature.USE_BIG_DECIMAL_FOR_FLOATS);
+        m.enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS);
         BigDecimal dec = new BigDecimal("0.1");
 
         // First test generic stand-alone Number
@@ -95,7 +95,7 @@
         ObjectMapper m = new ObjectMapper();
         BigDecimal dec = new BigDecimal("-19.37");
 
-        m.enable(DeserializationConfig.Feature.USE_BIG_DECIMAL_FOR_FLOATS);
+        m.enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS);
 
         // List element types
         @SuppressWarnings("unchecked")
diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/TestJdkTypes.java b/src/test/java/com/fasterxml/jackson/databind/deser/TestJdkTypes.java
index a9af7ef..27836e8 100644
--- a/src/test/java/com/fasterxml/jackson/databind/deser/TestJdkTypes.java
+++ b/src/test/java/com/fasterxml/jackson/databind/deser/TestJdkTypes.java
@@ -135,7 +135,7 @@
         
         // but not when enabled
         final ObjectMapper mapper2 = new ObjectMapper();
-        mapper2.configure(DeserializationConfig.Feature.FAIL_ON_NULL_FOR_PRIMITIVES, true);
+        mapper2.configure(DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES, true);
 
         // boolean
         try {
@@ -300,7 +300,7 @@
         assertTrue(ob instanceof List<?>);
 
         // but can change to produce Object[]:
-        mapper.configure(DeserializationConfig.Feature.USE_JAVA_ARRAY_FOR_JSON_ARRAY, true);
+        mapper.configure(DeserializationFeature.USE_JAVA_ARRAY_FOR_JSON_ARRAY, true);
         ob = mapper.readValue("[1]", Object.class);
         assertEquals(Object[].class, ob.getClass());
     }
diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/TestMapDeserialization.java b/src/test/java/com/fasterxml/jackson/databind/deser/TestMapDeserialization.java
index 12a4112..e01613a 100644
--- a/src/test/java/com/fasterxml/jackson/databind/deser/TestMapDeserialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/deser/TestMapDeserialization.java
@@ -161,7 +161,7 @@
     public void testFromEmptyString() throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.configure(DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
+        m.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
         Map<?,?> result = m.readValue(quote(""), Map.class);
         assertNull(result);
     }
diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/TestSetterlessProperties.java b/src/test/java/com/fasterxml/jackson/databind/deser/TestSetterlessProperties.java
index a8d92c7..471fd85 100644
--- a/src/test/java/com/fasterxml/jackson/databind/deser/TestSetterlessProperties.java
+++ b/src/test/java/com/fasterxml/jackson/databind/deser/TestSetterlessProperties.java
@@ -5,7 +5,6 @@
 import com.fasterxml.jackson.annotation.*;
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 
 /**
  * Unit tests for verifying that feature requested
@@ -74,9 +73,9 @@
     {
         ObjectMapper m = new ObjectMapper();
         // by default, it should be enabled
-        assertTrue(m.isEnabled(MapperConfig.Feature.USE_GETTERS_AS_SETTERS));
-        m.configure(MapperConfig.Feature.USE_GETTERS_AS_SETTERS, false);
-        assertFalse(m.isEnabled(MapperConfig.Feature.USE_GETTERS_AS_SETTERS));
+        assertTrue(m.isEnabled(MapperFeature.USE_GETTERS_AS_SETTERS));
+        m.configure(MapperFeature.USE_GETTERS_AS_SETTERS, false);
+        assertFalse(m.isEnabled(MapperFeature.USE_GETTERS_AS_SETTERS));
 
         // and now this should fail
         try {
@@ -106,7 +105,7 @@
         throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.configure(MapperConfig.Feature.USE_GETTERS_AS_SETTERS, false);
+        m.configure(MapperFeature.USE_GETTERS_AS_SETTERS, false);
         // so this should fail now without a setter
         try {
             m.readValue
@@ -123,7 +122,7 @@
     public void testSetterlessPrecedence() throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.configure(MapperConfig.Feature.USE_GETTERS_AS_SETTERS, true);
+        m.configure(MapperFeature.USE_GETTERS_AS_SETTERS, true);
         Dual value = m.readValue("{\"list\":[1,2,3]}, valueType)", Dual.class);
         assertNotNull(value);
         assertEquals(3, value.values.size());
diff --git a/src/test/java/com/fasterxml/jackson/databind/deser/TestUnknownProperties.java b/src/test/java/com/fasterxml/jackson/databind/deser/TestUnknownProperties.java
index ad9f335..935a9f1 100644
--- a/src/test/java/com/fasterxml/jackson/databind/deser/TestUnknownProperties.java
+++ b/src/test/java/com/fasterxml/jackson/databind/deser/TestUnknownProperties.java
@@ -133,7 +133,7 @@
         throws Exception
     {
         ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+        mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
         TestBean result = null;
         try {
             result = mapper.readValue(new StringReader(JSON_UNKNOWN_FIELD), TestBean.class);
diff --git a/src/test/java/com/fasterxml/jackson/databind/ext/TestCoreXMLTypes.java b/src/test/java/com/fasterxml/jackson/databind/ext/TestCoreXMLTypes.java
index faa44a9..7889af6 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ext/TestCoreXMLTypes.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ext/TestCoreXMLTypes.java
@@ -57,7 +57,7 @@
         assertEquals(timestamp, calOut.toGregorianCalendar().getTimeInMillis());
         
         // and then textual variant
-        mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);
+        mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
         // this is ALMOST same as default for XMLGregorianCalendar... just need to unify Z/+0000
         String exp = cal.toXMLFormat();
         String act = mapper.writeValueAsString(cal);
diff --git a/src/test/java/com/fasterxml/jackson/databind/ext/TestJodaTime.java b/src/test/java/com/fasterxml/jackson/databind/ext/TestJodaTime.java
index b79fab7..ec4fdaa 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ext/TestJodaTime.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ext/TestJodaTime.java
@@ -36,7 +36,7 @@
 
         // but if re-configured, as regular ISO-8601 string
         m = new ObjectMapper();
-        m.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);
+        m.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
         assertEquals(quote("1970-01-01T00:00:00.000Z"), serializeAsString(m, dt));
     }
 
@@ -100,7 +100,7 @@
         assertEquals("[2001,5,25]", mapper.writeValueAsString(date));
         // but we can force it to be a String as well (note: here we assume this is
         // dynamically changeable)
-        mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);        
+        mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);        
         assertEquals(quote("2001-05-25"), mapper.writeValueAsString(date));
     }
 
@@ -138,7 +138,7 @@
         assertEquals("[2001,5,25]", mapper.writeValueAsString(date));
         // but we can force it to be a String as well (note: here we assume this is
         // dynamically changeable)
-        mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);        
+        mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);        
         assertEquals(quote("2001-05-25"), mapper.writeValueAsString(date));
     }
 
@@ -177,7 +177,7 @@
         assertEquals("[2001,5,25,10,15,30,37]", mapper.writeValueAsString(date));
         // but we can force it to be a String as well (note: here we assume this is
         // dynamically changeable)
-        mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);        
+        mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);        
         assertEquals(quote("2001-05-25T10:15:30.037"), mapper.writeValueAsString(date));
     }
 
diff --git a/src/test/java/com/fasterxml/jackson/databind/introspect/TestJacksonAnnotationIntrospector.java b/src/test/java/com/fasterxml/jackson/databind/introspect/TestJacksonAnnotationIntrospector.java
index b852253..339a7cc 100644
--- a/src/test/java/com/fasterxml/jackson/databind/introspect/TestJacksonAnnotationIntrospector.java
+++ b/src/test/java/com/fasterxml/jackson/databind/introspect/TestJacksonAnnotationIntrospector.java
@@ -155,7 +155,7 @@
     public void testSerializeDeserializeWithJaxbAnnotations() throws Exception
     {
         ObjectMapper mapper = new ObjectMapper();
-        mapper.enable(SerializationConfig.Feature.INDENT_OUTPUT);
+        mapper.enable(SerializationFeature.INDENT_OUTPUT);
         JacksonExample ex = new JacksonExample();
         QName qname = new QName("urn:hi", "hello");
         ex.setQname(qname);
diff --git a/src/test/java/com/fasterxml/jackson/databind/introspect/TestPOJOPropertiesCollector.java b/src/test/java/com/fasterxml/jackson/databind/introspect/TestPOJOPropertiesCollector.java
index 039e590..9ced40b 100644
--- a/src/test/java/com/fasterxml/jackson/databind/introspect/TestPOJOPropertiesCollector.java
+++ b/src/test/java/com/fasterxml/jackson/databind/introspect/TestPOJOPropertiesCollector.java
@@ -7,7 +7,6 @@
 
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 
 public class TestPOJOPropertiesCollector
     extends BaseMapTest
@@ -301,7 +300,7 @@
     public void testGlobalVisibilityForGetters()
     {
         ObjectMapper m = new ObjectMapper();
-        m.configure(MapperConfig.Feature.AUTO_DETECT_GETTERS, false);
+        m.configure(MapperFeature.AUTO_DETECT_GETTERS, false);
         POJOPropertiesCollector coll = collector(m, SimpleGetterVisibility.class, true);
         // should be 1, expect that we disabled getter auto-detection, so
         Map<String, POJOPropertyBuilder> props = coll.getPropertyMap();
@@ -372,7 +371,7 @@
     public void testJackson703() throws Exception
     {
         ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(MapperConfig.Feature.USE_ANNOTATIONS, false);
+        mapper.configure(MapperFeature.USE_ANNOTATIONS, false);
         BasicBeanDescription beanDesc = mapper.getSerializationConfig().introspect(mapper.constructType(Jackson703.class));
         assertNotNull(beanDesc);
 
diff --git a/src/test/java/com/fasterxml/jackson/databind/jsontype/TestAbstractTypeNames.java b/src/test/java/com/fasterxml/jackson/databind/jsontype/TestAbstractTypeNames.java
index 2710e89..33ec314 100644
--- a/src/test/java/com/fasterxml/jackson/databind/jsontype/TestAbstractTypeNames.java
+++ b/src/test/java/com/fasterxml/jackson/databind/jsontype/TestAbstractTypeNames.java
@@ -99,7 +99,7 @@
     public void testEmptyCollection() throws Exception
     {
         ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
+        mapper.configure(SerializationFeature.INDENT_OUTPUT, true);
         List<User>friends = new ArrayList<User>();
         friends.add(new DefaultUser("Joe Hildebrandt", null));
         friends.add(new DefaultEmployee("Richard Nasr",null,"MDA"));
diff --git a/src/test/java/com/fasterxml/jackson/databind/jsontype/TestGenericListSerialization.java b/src/test/java/com/fasterxml/jackson/databind/jsontype/TestGenericListSerialization.java
index 341d933..365b466 100644
--- a/src/test/java/com/fasterxml/jackson/databind/jsontype/TestGenericListSerialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/jsontype/TestGenericListSerialization.java
@@ -9,7 +9,6 @@
 import com.fasterxml.jackson.core.type.TypeReference;
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 import com.fasterxml.jackson.databind.type.TypeFactory;
 
 public class TestGenericListSerialization
@@ -66,7 +65,7 @@
         embedded.add(new Child1());
         embedded.add(new Child2());
         input.setResult(embedded);
-        mapper.configure(MapperConfig.Feature.USE_STATIC_TYPING, true);
+        mapper.configure(MapperFeature.USE_STATIC_TYPING, true);
 
         JavaType rootType = TypeFactory.defaultInstance().constructType(new TypeReference<JSONResponse<List<Parent>>>() { });
         byte[] json = mapper.writerWithType(rootType).writeValueAsBytes(input);
diff --git a/src/test/java/com/fasterxml/jackson/databind/jsontype/TestSubtypes.java b/src/test/java/com/fasterxml/jackson/databind/jsontype/TestSubtypes.java
index e63af3f..29f83a5 100644
--- a/src/test/java/com/fasterxml/jackson/databind/jsontype/TestSubtypes.java
+++ b/src/test/java/com/fasterxml/jackson/databind/jsontype/TestSubtypes.java
@@ -7,7 +7,7 @@
 import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
 import com.fasterxml.jackson.databind.JsonMappingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationConfig;
+import com.fasterxml.jackson.databind.SerializationFeature;
 import com.fasterxml.jackson.databind.jsontype.NamedType;
 import com.fasterxml.jackson.databind.module.SimpleModule;
 
@@ -143,19 +143,19 @@
     {
         // First, with annotations
         ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, true);
+        mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, true);
         String json = mapper.writeValueAsString(new EmptyBean());
         assertEquals("{\"@type\":\"TestSubtypes$EmptyBean\"}", json);
 
         mapper = new ObjectMapper();
-        mapper.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false);
+        mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
         json = mapper.writeValueAsString(new EmptyBean());
         assertEquals("{\"@type\":\"TestSubtypes$EmptyBean\"}", json);
 
         // and then with defaults
         mapper = new ObjectMapper();
         mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
-        mapper.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false);
+        mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
         json = mapper.writeValueAsString(new EmptyNonFinal());
         assertEquals("[\"com.fasterxml.jackson.databind.jsontype.TestSubtypes$EmptyNonFinal\",{}]", json);
     }
diff --git a/src/test/java/com/fasterxml/jackson/databind/jsontype/TestTypedArraySerialization.java b/src/test/java/com/fasterxml/jackson/databind/jsontype/TestTypedArraySerialization.java
index 8a44e40..aed0f81 100644
--- a/src/test/java/com/fasterxml/jackson/databind/jsontype/TestTypedArraySerialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/jsontype/TestTypedArraySerialization.java
@@ -5,7 +5,6 @@
 import com.fasterxml.jackson.annotation.*;
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 
 /**
  * Unit tests for verifying that types that serialize as JSON Arrays
@@ -150,7 +149,7 @@
 
         // then with static typing enabled:
         m = new ObjectMapper();
-        m.configure(MapperConfig.Feature.USE_STATIC_TYPING, true);
+        m.configure(MapperFeature.USE_STATIC_TYPING, true);
         assertEquals(EXP, m.writeValueAsString(input));
     }
 }
diff --git a/src/test/java/com/fasterxml/jackson/databind/jsontype/TestTypedSerialization.java b/src/test/java/com/fasterxml/jackson/databind/jsontype/TestTypedSerialization.java
index 9246ad6..cd857f9 100644
--- a/src/test/java/com/fasterxml/jackson/databind/jsontype/TestTypedSerialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/jsontype/TestTypedSerialization.java
@@ -182,7 +182,7 @@
     public void testEmptyBean() throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false);
+        m.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
         assertEquals("{\"@type\":\"empty\"}", m.writeValueAsString(new Empty()));
     }
 
diff --git a/src/test/java/com/fasterxml/jackson/databind/jsontype/TestWithGenerics.java b/src/test/java/com/fasterxml/jackson/databind/jsontype/TestWithGenerics.java
index f17446d..c5e695f 100644
--- a/src/test/java/com/fasterxml/jackson/databind/jsontype/TestWithGenerics.java
+++ b/src/test/java/com/fasterxml/jackson/databind/jsontype/TestWithGenerics.java
@@ -155,7 +155,7 @@
         ObjectMapper om = new ObjectMapper();
         om.enableDefaultTyping( ObjectMapper.DefaultTyping.JAVA_LANG_OBJECT, JsonTypeInfo.As.PROPERTY );
         om.setSerializationInclusion(JsonInclude.Include.NON_NULL );
-        om.enable( SerializationConfig.Feature.INDENT_OUTPUT);
+        om.enable( SerializationFeature.INDENT_OUTPUT);
 
         MyClass mc = new MyClass();
 
diff --git a/src/test/java/com/fasterxml/jackson/databind/mixins/TestMixinSerWithViews.java b/src/test/java/com/fasterxml/jackson/databind/mixins/TestMixinSerWithViews.java
index 6a5dde0..03a8089 100644
--- a/src/test/java/com/fasterxml/jackson/databind/mixins/TestMixinSerWithViews.java
+++ b/src/test/java/com/fasterxml/jackson/databind/mixins/TestMixinSerWithViews.java
@@ -5,7 +5,6 @@
 import com.fasterxml.jackson.annotation.*;
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 
 public class TestMixinSerWithViews
     extends BaseMapTest
@@ -175,8 +174,8 @@
         ObjectMapper mapper = new ObjectMapper();
         A a = new A("myname", 29, "mysurname");
 
-        // Property SerializationConfig.Feature.DEFAULT_VIEW_INCLUSION set to false
-        mapper.configure(MapperConfig.Feature.DEFAULT_VIEW_INCLUSION, Boolean.FALSE);
+        // Property SerializationConfig.SerializationFeature.DEFAULT_VIEW_INCLUSION set to false
+        mapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, Boolean.FALSE);
         mapper.addMixInAnnotations(A.class, AMixInAnnotation.class);
         String json = mapper.writerWithView(AView.class).writeValueAsString(a);
 
@@ -192,9 +191,9 @@
     private ObjectMapper createObjectMapper( )
     {
       ObjectMapper objectMapper = new ObjectMapper( );
-      objectMapper.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false );
+      objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false );
       objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL );
-      objectMapper.configure(MapperConfig.Feature.DEFAULT_VIEW_INCLUSION, false );
+      objectMapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, false );
 
       Map<Class<?>, Class<?>> sourceMixins = new HashMap<Class<?>, Class<?>>( );
       sourceMixins.put( SimpleTestData.class, TestDataJAXBMixin.class );
diff --git a/src/test/java/com/fasterxml/jackson/databind/module/TestTypeModifiers.java b/src/test/java/com/fasterxml/jackson/databind/module/TestTypeModifiers.java
index 5dd6cd5..944d373 100644
--- a/src/test/java/com/fasterxml/jackson/databind/module/TestTypeModifiers.java
+++ b/src/test/java/com/fasterxml/jackson/databind/module/TestTypeModifiers.java
@@ -6,6 +6,8 @@
 import com.fasterxml.jackson.core.*;
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
 import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
 import com.fasterxml.jackson.databind.module.SimpleDeserializers;
diff --git a/src/test/java/com/fasterxml/jackson/databind/module/TestValueInstantiator.java b/src/test/java/com/fasterxml/jackson/databind/module/TestValueInstantiator.java
index 248b24c..1f7f312 100644
--- a/src/test/java/com/fasterxml/jackson/databind/module/TestValueInstantiator.java
+++ b/src/test/java/com/fasterxml/jackson/databind/module/TestValueInstantiator.java
@@ -5,6 +5,7 @@
 import com.fasterxml.jackson.core.Version;
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.databind.annotation.JsonValueInstantiator;
+import com.fasterxml.jackson.databind.cfg.DeserializationConfig;
 import com.fasterxml.jackson.databind.deser.*;
 import com.fasterxml.jackson.databind.module.SimpleModule;
 import com.fasterxml.jackson.databind.type.TypeFactory;
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotationAnyGetter.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotationAnyGetter.java
index 3013bd0..7074f00 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotationAnyGetter.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotationAnyGetter.java
@@ -6,7 +6,7 @@
 
 import com.fasterxml.jackson.databind.BaseMapTest;
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationConfig;
+import com.fasterxml.jackson.databind.SerializationFeature;
 
 public class TestAnnotationAnyGetter
     extends BaseMapTest
@@ -63,13 +63,13 @@
 
         // First, with normal fail settings:
         m = new ObjectMapper();
-        m.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, true);
+        m.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, true);
         String json = serializeAsString(m, new AnyOnlyBean());
         assertEquals("{\"a\":3}", json);
 
         // then without fail
         m = new ObjectMapper();
-        m.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false);
+        m.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
         json = serializeAsString(m, new AnyOnlyBean());
         assertEquals("{\"a\":3}", json);
     }
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotationJsonSerialize.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotationJsonSerialize.java
index 4750aec..d47246b 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotationJsonSerialize.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotationJsonSerialize.java
@@ -8,7 +8,6 @@
 
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 
 /**
  * This unit test suite tests use of @JsonClass Annotation
@@ -192,7 +191,7 @@
     public void testStaticTypingWithMap() throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.configure(MapperConfig.Feature.USE_STATIC_TYPING, true);
+        m.configure(MapperFeature.USE_STATIC_TYPING, true);
         ValueMap map = new ValueMap();
         map.put("a", new ValueClass());
         assertEquals("{\"a\":{\"x\":3}}", serializeAsString(m, map));
@@ -201,7 +200,7 @@
     public void testStaticTypingWithArrayList() throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.configure(MapperConfig.Feature.USE_STATIC_TYPING, true);
+        m.configure(MapperFeature.USE_STATIC_TYPING, true);
         ValueList list = new ValueList();
         list.add(new ValueClass());
         assertEquals("[{\"x\":3}]", m.writeValueAsString(list));
@@ -210,7 +209,7 @@
     public void testStaticTypingWithLinkedList() throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.configure(MapperConfig.Feature.USE_STATIC_TYPING, true);
+        m.configure(MapperFeature.USE_STATIC_TYPING, true);
         ValueLinkedList list = new ValueLinkedList();
         list.add(new ValueClass());
         assertEquals("[{\"x\":3}]", serializeAsString(m, list));
@@ -219,7 +218,7 @@
     public void testStaticTypingWithArray() throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.configure(MapperConfig.Feature.USE_STATIC_TYPING, true);
+        m.configure(MapperFeature.USE_STATIC_TYPING, true);
         ValueInterface[] array = new ValueInterface[] { new ValueClass() };
         assertEquals("[{\"x\":3}]", serializeAsString(m, array));
     }
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotationJsonValue.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotationJsonValue.java
index 3a1e098..22de7bb 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotationJsonValue.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotationJsonValue.java
@@ -7,7 +7,6 @@
 
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 
 /**
@@ -127,7 +126,7 @@
 
         // then static
         ObjectMapper staticMapper = new ObjectMapper();
-        staticMapper.configure(MapperConfig.Feature.USE_STATIC_TYPING, true);
+        staticMapper.configure(MapperFeature.USE_STATIC_TYPING, true);
         assertEquals("{\"a\":\"a\"}", staticMapper.writeValueAsString(new ValueWrapper()));
     }
 
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotations.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotations.java
index 802bad4..95c3706 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotations.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestAnnotations.java
@@ -9,7 +9,6 @@
 
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 
 /**
  * This unit test suite tests use of Annotations for
@@ -101,7 +100,7 @@
         public int getZ() { return 3; }
     }
 
-    // For [JACKSON-666] ("Feature of the Beast!")
+    // For [JACKSON-666] ("SerializationFeature of the Beast!")
     @JsonPropertyOrder(alphabetic=true)
     static class GettersWithoutSetters
     {
@@ -240,14 +239,14 @@
     {
         ObjectMapper m = new ObjectMapper();
         GettersWithoutSetters bean = new GettersWithoutSetters(123);
-        assertFalse(m.isEnabled(MapperConfig.Feature.REQUIRE_SETTERS_FOR_GETTERS));
+        assertFalse(m.isEnabled(MapperFeature.REQUIRE_SETTERS_FOR_GETTERS));
     
         // by default, all 4 found:
         assertEquals("{\"a\":3,\"b\":4,\"c\":5,\"d\":6}", m.writeValueAsString(bean));
 
         // but 3 if we require mutator:
         m = new ObjectMapper();
-        m.enable(MapperConfig.Feature.REQUIRE_SETTERS_FOR_GETTERS);
+        m.enable(MapperFeature.REQUIRE_SETTERS_FOR_GETTERS);
         assertEquals("{\"a\":3,\"c\":5,\"d\":6}", m.writeValueAsString(bean));
     }
 }
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestBeanSerializer.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestBeanSerializer.java
index 60bf590..c1b1636 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestBeanSerializer.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestBeanSerializer.java
@@ -7,6 +7,7 @@
 import com.fasterxml.jackson.core.*;
 
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.introspect.AnnotatedField;
 import com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder;
 import com.fasterxml.jackson.databind.module.SimpleModule;
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestCollectionSerialization.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestCollectionSerialization.java
index c6a4a96..36f2146 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestCollectionSerialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestCollectionSerialization.java
@@ -310,13 +310,13 @@
         EmptyListBean list = new EmptyListBean();
         EmptyArrayBean array = new EmptyArrayBean();
         ObjectMapper m = new ObjectMapper();
-        assertTrue(m.getSerializationConfig().isEnabled(SerializationConfig.Feature.WRITE_EMPTY_JSON_ARRAYS));
+        assertTrue(m.getSerializationConfig().isEnabled(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS));
         assertEquals("{\"empty\":[]}", m.writeValueAsString(list));
         assertEquals("{\"empty\":[]}", m.writeValueAsString(array));
 
         // note: value of setting may be cached when constructing serializer, need a new instance
         m = new ObjectMapper();
-        m.configure(SerializationConfig.Feature.WRITE_EMPTY_JSON_ARRAYS, false);
+        m.configure(SerializationFeature.WRITE_EMPTY_JSON_ARRAYS, false);
         assertEquals("{}", m.writeValueAsString(list));
         assertEquals("{}", m.writeValueAsString(array));
     }
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestConfig.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestConfig.java
index 29cee28..7ca03e7 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestConfig.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestConfig.java
@@ -4,7 +4,7 @@
 
 import com.fasterxml.jackson.annotation.*;
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 
 /**
@@ -43,22 +43,22 @@
         SerializationConfig cfg = m.getSerializationConfig();
 
         // First, defaults:
-        assertTrue(cfg.isEnabled(MapperConfig.Feature.USE_ANNOTATIONS));
-        assertTrue(cfg.isEnabled(MapperConfig.Feature.AUTO_DETECT_GETTERS));
-        assertTrue(cfg.isEnabled(MapperConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS));
+        assertTrue(cfg.isEnabled(MapperFeature.USE_ANNOTATIONS));
+        assertTrue(cfg.isEnabled(MapperFeature.AUTO_DETECT_GETTERS));
+        assertTrue(cfg.isEnabled(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS));
 
-        assertTrue(cfg.isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS));
+        assertTrue(cfg.isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS));
 
-        assertFalse(cfg.isEnabled(SerializationConfig.Feature.INDENT_OUTPUT));
-        assertFalse(cfg.isEnabled(MapperConfig.Feature.USE_STATIC_TYPING));
+        assertFalse(cfg.isEnabled(SerializationFeature.INDENT_OUTPUT));
+        assertFalse(cfg.isEnabled(MapperFeature.USE_STATIC_TYPING));
 
         // since 1.3:
-        assertTrue(cfg.isEnabled(MapperConfig.Feature.AUTO_DETECT_IS_GETTERS));
+        assertTrue(cfg.isEnabled(MapperFeature.AUTO_DETECT_IS_GETTERS));
         // since 1.4
         
-        assertTrue(cfg.isEnabled(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS));
+        assertTrue(cfg.isEnabled(SerializationFeature.FAIL_ON_EMPTY_BEANS));
         // since 1.5
-        assertTrue(cfg.isEnabled(MapperConfig.Feature.DEFAULT_VIEW_INCLUSION));
+        assertTrue(cfg.isEnabled(MapperFeature.DEFAULT_VIEW_INCLUSION));
 
     }
 
@@ -82,7 +82,7 @@
     public void testIndentation() throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
+        m.configure(SerializationFeature.INDENT_OUTPUT, true);
         Map<String,Integer> map = new HashMap<String,Integer>();
         map.put("a", Integer.valueOf(2));
         String result = serializeAsString(m, map).trim();
@@ -95,12 +95,12 @@
     {
         // first: verify that annotation introspection is enabled by default
         ObjectMapper m = new ObjectMapper();
-        assertTrue(m.isEnabled(MapperConfig.Feature.USE_ANNOTATIONS));
+        assertTrue(m.isEnabled(MapperFeature.USE_ANNOTATIONS));
         Map<String,Object> result = writeAndMap(m, new AnnoBean());
         assertEquals(2, result.size());
 
         m = new ObjectMapper();
-        m.configure(MapperConfig.Feature.USE_ANNOTATIONS, false);
+        m.configure(MapperFeature.USE_ANNOTATIONS, false);
         result = writeAndMap(m, new AnnoBean());
         assertEquals(1, result.size());
     }
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestDateSerialization.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestDateSerialization.java
index 19cfb29..12dd1d7 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestDateSerialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestDateSerialization.java
@@ -31,7 +31,7 @@
         ObjectMapper mapper = new ObjectMapper();
         StringWriter sw = new StringWriter();
         // default is to output time stamps...
-        assertTrue(mapper.getSerializationConfig().isEnabled(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS));
+        assertTrue(mapper.getSerializationConfig().isEnabled(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS));
         // shouldn't matter which offset we give...
         mapper.writeValue(sw, new Date(199L));
         assertEquals("199", sw.toString());
@@ -41,7 +41,7 @@
     {
         ObjectMapper mapper = new ObjectMapper();
         StringWriter sw = new StringWriter();
-        mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);
+        mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
         // let's hit epoch start
         mapper.writeValue(sw, new Date(0L));
         assertEquals("\"1970-01-01T00:00:00.000+0000\"", sw.toString());
@@ -104,13 +104,13 @@
     {
         ObjectMapper mapper = new ObjectMapper();
         Map<Date,Integer> map = new HashMap<Date,Integer>();
-        assertFalse(mapper.isEnabled(SerializationConfig.Feature.WRITE_DATE_KEYS_AS_TIMESTAMPS));
+        assertFalse(mapper.isEnabled(SerializationFeature.WRITE_DATE_KEYS_AS_TIMESTAMPS));
         map.put(new Date(0L), Integer.valueOf(1));
         // by default will serialize as ISO-8601 values...
         assertEquals("{\"1970-01-01T00:00:00.000+0000\":1}", mapper.writeValueAsString(map));
         
         // but can change to use timestamps too
-        mapper.configure(SerializationConfig.Feature.WRITE_DATE_KEYS_AS_TIMESTAMPS, true);
+        mapper.configure(SerializationFeature.WRITE_DATE_KEYS_AS_TIMESTAMPS, true);
         assertEquals("{\"0\":1}", mapper.writeValueAsString(map));
     }
 }
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestEmptyClass.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestEmptyClass.java
index 932ea17..6aa1857 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestEmptyClass.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestEmptyClass.java
@@ -84,8 +84,8 @@
     public void testEmptyWithFeature() throws Exception
     {
         // should be enabled by default
-        assertTrue(mapper.getSerializationConfig().isEnabled(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS));
-        mapper.configure(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false);
+        assertTrue(mapper.getSerializationConfig().isEnabled(SerializationFeature.FAIL_ON_EMPTY_BEANS));
+        mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
         assertEquals("{}", serializeAsString(mapper, new Empty()));
     }
 
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestEnumSerialization.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestEnumSerialization.java
index e839c2b..3a212c0 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestEnumSerialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestEnumSerialization.java
@@ -180,7 +180,7 @@
     public void testToStringEnum() throws Exception
     {
         ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(SerializationConfig.Feature.WRITE_ENUMS_USING_TO_STRING, true);
+        mapper.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true);
         assertEquals("\"b\"", mapper.writeValueAsString(LowerCaseEnum.B));
     }
 
@@ -188,7 +188,7 @@
     public void testToStringEnumWithEnumMap() throws Exception
     {
         ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(SerializationConfig.Feature.WRITE_ENUMS_USING_TO_STRING, true);
+        mapper.configure(SerializationFeature.WRITE_ENUMS_USING_TO_STRING, true);
         EnumMap<LowerCaseEnum,String> m = new EnumMap<LowerCaseEnum,String>(LowerCaseEnum.class);
         m.put(LowerCaseEnum.C, "value");
         assertEquals("{\"c\":\"value\"}", mapper.writeValueAsString(m));
@@ -208,11 +208,11 @@
     {
         // By default, serialize using name
         ObjectMapper mapper = new ObjectMapper();
-        assertFalse(mapper.isEnabled(SerializationConfig.Feature.WRITE_ENUMS_USING_INDEX));
+        assertFalse(mapper.isEnabled(SerializationFeature.WRITE_ENUMS_USING_INDEX));
         assertEquals(quote("B"), mapper.writeValueAsString(TestEnum.B));
 
         // but we can change (dynamically, too!) it to be number-based
-        mapper.enable(SerializationConfig.Feature.WRITE_ENUMS_USING_INDEX);
+        mapper.enable(SerializationFeature.WRITE_ENUMS_USING_INDEX);
         assertEquals("1", mapper.writeValueAsString(TestEnum.B));
     }
 
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestFeatures.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestFeatures.java
index 847e8ab..9f42fba 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestFeatures.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestFeatures.java
@@ -8,7 +8,6 @@
 import com.fasterxml.jackson.databind.*;
 import com.fasterxml.jackson.annotation.*;
 import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 
 /**
  * Unit tests for checking whether JsonSerializerFactory.Feature
@@ -99,7 +98,7 @@
         // Then auto-detection disabled. But note: we MUST create a new
         // mapper, since old version of serializer may be cached by now
         m = new ObjectMapper();
-        m.configure(MapperConfig.Feature.AUTO_DETECT_GETTERS, false);
+        m.configure(MapperFeature.AUTO_DETECT_GETTERS, false);
         result = writeAndMap(m, new GetterClass());
         assertEquals(1, result.size());
         assertTrue(result.containsKey("x"));
@@ -114,7 +113,7 @@
         assertTrue(result.containsKey("x"));
 
         // And then class-level auto-detection enabling, should override defaults
-        m.configure(MapperConfig.Feature.AUTO_DETECT_GETTERS, false);
+        m.configure(MapperFeature.AUTO_DETECT_GETTERS, false);
         result = writeAndMap(m, new EnabledGetterClass());
         assertEquals(2, result.size());
         assertTrue(result.containsKey("x"));
@@ -125,8 +124,8 @@
     {
         ObjectMapper m = new ObjectMapper();
         // class level should override
-        m.configure(MapperConfig.Feature.AUTO_DETECT_GETTERS, true);
-        m.configure(MapperConfig.Feature.AUTO_DETECT_IS_GETTERS, false);
+        m.configure(MapperFeature.AUTO_DETECT_GETTERS, true);
+        m.configure(MapperFeature.AUTO_DETECT_IS_GETTERS, false);
          Map<String,Object> result = writeAndMap(m, new EnabledIsGetterClass());
         assertEquals(1, result.size());
         assertTrue(result.containsKey("ok"));
@@ -137,12 +136,12 @@
     public void testConfigChainability()
     {
         ObjectMapper m = new ObjectMapper();
-        assertTrue(m.isEnabled(MapperConfig.Feature.AUTO_DETECT_SETTERS));
-        assertTrue(m.isEnabled(MapperConfig.Feature.AUTO_DETECT_GETTERS));
-        m.configure(MapperConfig.Feature.AUTO_DETECT_SETTERS, false)
-            .configure(MapperConfig.Feature.AUTO_DETECT_GETTERS, false);
-        assertFalse(m.isEnabled(MapperConfig.Feature.AUTO_DETECT_SETTERS));
-        assertFalse(m.isEnabled(MapperConfig.Feature.AUTO_DETECT_GETTERS));
+        assertTrue(m.isEnabled(MapperFeature.AUTO_DETECT_SETTERS));
+        assertTrue(m.isEnabled(MapperFeature.AUTO_DETECT_GETTERS));
+        m.configure(MapperFeature.AUTO_DETECT_SETTERS, false)
+            .configure(MapperFeature.AUTO_DETECT_GETTERS, false);
+        assertFalse(m.isEnabled(MapperFeature.AUTO_DETECT_SETTERS));
+        assertFalse(m.isEnabled(MapperFeature.AUTO_DETECT_GETTERS));
     }
 
     // Test for [JACKSON-282]
@@ -155,7 +154,7 @@
         assertFalse(bean.wasClosed);
 
         // but can enable it:
-        m.configure(SerializationConfig.Feature.CLOSE_CLOSEABLE, true);
+        m.configure(SerializationFeature.CLOSE_CLOSEABLE, true);
         bean = new CloseableBean();
         m.writeValueAsString(bean);
         assertTrue(bean.wasClosed);
@@ -175,7 +174,7 @@
         assertEquals(quote("abc"), m.writeValueAsString(chars));
         
         // new feature: serialize as JSON array:
-        m.configure(SerializationConfig.Feature.WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS, true);
+        m.configure(SerializationFeature.WRITE_CHAR_ARRAYS_AS_JSON_ARRAYS, true);
         assertEquals("[\"a\",\"b\",\"c\"]", m.writeValueAsString(chars));
     }
 
@@ -183,7 +182,7 @@
     public void testFlushingAutomatic() throws IOException
     {
         ObjectMapper mapper = new ObjectMapper();
-        assertTrue(mapper.getSerializationConfig().isEnabled(SerializationConfig.Feature.FLUSH_AFTER_WRITE_VALUE));
+        assertTrue(mapper.getSerializationConfig().isEnabled(SerializationFeature.FLUSH_AFTER_WRITE_VALUE));
         // default is to flush after writeValue()
         StringWriter sw = new StringWriter();
         JsonGenerator jgen = mapper.getJsonFactory().createJsonGenerator(sw);
@@ -205,7 +204,7 @@
     {
         // but should not occur if configured otherwise
         ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(SerializationConfig.Feature.FLUSH_AFTER_WRITE_VALUE, false);
+        mapper.configure(SerializationFeature.FLUSH_AFTER_WRITE_VALUE, false);
         StringWriter sw = new StringWriter();
         JsonGenerator jgen = mapper.getJsonFactory().createJsonGenerator(sw);
 
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestMapSerialization.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestMapSerialization.java
index 332d06f..520ac4e 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestMapSerialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestMapSerialization.java
@@ -76,7 +76,7 @@
         // by default, should output null-valued entries:
         assertEquals("{\"a\":null}", m.writeValueAsString(map));
         // but not if explicitly asked not to (note: config value is dynamic here)
-        m.configure(SerializationConfig.Feature.WRITE_NULL_MAP_VALUES, false);
+        m.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false);
         assertEquals("{}", m.writeValueAsString(map));
     }
 
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestNullSerialization.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestNullSerialization.java
index da98874..c2fc88e 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestNullSerialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestNullSerialization.java
@@ -4,6 +4,7 @@
 
 import com.fasterxml.jackson.core.*;
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 
 public class TestNullSerialization
     extends BaseMapTest
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestRootType.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestRootType.java
index bee63d0..bd2fc6b 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestRootType.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestRootType.java
@@ -6,12 +6,10 @@
 
 import com.fasterxml.jackson.core.*;
 import com.fasterxml.jackson.annotation.*;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
 import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
 import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 import com.fasterxml.jackson.databind.type.TypeFactory;
 
 /**
@@ -107,7 +105,7 @@
     {
         ObjectMapper mapper = new ObjectMapper();
         // must force static typing, otherwise won't matter a lot
-        mapper.configure(MapperConfig.Feature.USE_STATIC_TYPING, true);
+        mapper.configure(MapperFeature.USE_STATIC_TYPING, true);
         SubType[] ob = new SubType[] { new SubType() };
         String json = mapper.writerWithType(BaseInterface[].class).writeValueAsString(ob);
         // should propagate interface type through due to root declaration; static typing
@@ -160,7 +158,7 @@
     public void testRootWrapping() throws Exception
     {
         ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
+        mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
         String json = mapper.writeValueAsString(new StringWrapper("abc"));
         assertEquals("{\"StringWrapper\":{\"str\":\"abc\"}}", json);
     }
@@ -182,7 +180,7 @@
     public void testRootNameAnnotation() throws Exception
     {
         ObjectMapper mapper = new ObjectMapper();
-        mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);
+        mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
         String json = mapper.writeValueAsString(new WithRootName());
         assertEquals("{\"root\":{\"a\":3}}", json);
     }
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestSerializationOrder.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestSerializationOrder.java
index a3f8a8b..8b269ae 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestSerializationOrder.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestSerializationOrder.java
@@ -3,7 +3,6 @@
 import com.fasterxml.jackson.annotation.*;
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 
 /**
  * Unit tests for verifying that constraints on ordering of serialized
@@ -114,7 +113,7 @@
     public void testOrderWithFeature() throws Exception
     {
         ObjectMapper m = new ObjectMapper();
-        m.configure(MapperConfig.Feature.SORT_PROPERTIES_ALPHABETICALLY, true);
+        m.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
         assertEquals("{\"a\":1,\"b\":2,\"c\":3,\"d\":4}", serializeAsString(m, new BeanFor459()));
     }
 }
diff --git a/src/test/java/com/fasterxml/jackson/databind/ser/TestSerializerProvider.java b/src/test/java/com/fasterxml/jackson/databind/ser/TestSerializerProvider.java
index 2f263c9..52f3350 100644
--- a/src/test/java/com/fasterxml/jackson/databind/ser/TestSerializerProvider.java
+++ b/src/test/java/com/fasterxml/jackson/databind/ser/TestSerializerProvider.java
@@ -1,6 +1,7 @@
 package com.fasterxml.jackson.databind.ser;
 
 import com.fasterxml.jackson.databind.*;
+import com.fasterxml.jackson.databind.cfg.SerializationConfig;
 import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
 
 public class TestSerializerProvider
diff --git a/src/test/java/com/fasterxml/jackson/databind/views/TestViewDeserialization.java b/src/test/java/com/fasterxml/jackson/databind/views/TestViewDeserialization.java
index 959924b..e5e4edc 100644
--- a/src/test/java/com/fasterxml/jackson/databind/views/TestViewDeserialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/views/TestViewDeserialization.java
@@ -3,7 +3,6 @@
 import com.fasterxml.jackson.annotation.JsonView;
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 
 public class TestViewDeserialization extends BaseMapTest
 {
@@ -92,7 +91,7 @@
         assertEquals(9, bean.b);
 
         ObjectMapper myMapper = new ObjectMapper();
-        myMapper.disable(MapperConfig.Feature.DEFAULT_VIEW_INCLUSION);
+        myMapper.disable(MapperFeature.DEFAULT_VIEW_INCLUSION);
 
         // but with, say, AA, will not get 'b'
         bean = myMapper.readerWithView(ViewAA.class)
diff --git a/src/test/java/com/fasterxml/jackson/databind/views/TestViewSerialization.java b/src/test/java/com/fasterxml/jackson/databind/views/TestViewSerialization.java
index 31e3fbe..b20e12e 100644
--- a/src/test/java/com/fasterxml/jackson/databind/views/TestViewSerialization.java
+++ b/src/test/java/com/fasterxml/jackson/databind/views/TestViewSerialization.java
@@ -6,7 +6,6 @@
 import com.fasterxml.jackson.annotation.*;
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 
 /**
  * Unit tests for verifying JSON view functionality: ability to declaratively
@@ -138,7 +137,7 @@
 
         // but can also change (but not necessarily on the fly...)
         mapper = new ObjectMapper();
-        mapper.configure(MapperConfig.Feature.DEFAULT_VIEW_INCLUSION, false);
+        mapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, false);
         // with this setting, only explicit inclusions count:
         String json = mapper.writerWithView(ViewA.class).writeValueAsString(bean);
         map = mapper.readValue(json, Map.class);
diff --git a/src/test/java/com/fasterxml/jackson/databind/views/TestViewsSerialization2.java b/src/test/java/com/fasterxml/jackson/databind/views/TestViewsSerialization2.java
index e64e43e..eac65b2 100644
--- a/src/test/java/com/fasterxml/jackson/databind/views/TestViewsSerialization2.java
+++ b/src/test/java/com/fasterxml/jackson/databind/views/TestViewsSerialization2.java
@@ -5,7 +5,6 @@
 import com.fasterxml.jackson.annotation.*;
 
 import com.fasterxml.jackson.databind.*;
-import com.fasterxml.jackson.databind.cfg.MapperConfig;
 
 public class TestViewsSerialization2 extends BaseMapTest
 {
@@ -38,10 +37,10 @@
   private ObjectMapper createObjectMapper(Class<?> viewClass)
   {
     ObjectMapper objectMapper = new ObjectMapper( );
-    objectMapper.configure( SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS, false );
+    objectMapper.configure( SerializationFeature.FAIL_ON_EMPTY_BEANS, false );
     objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL );
-    objectMapper.configure(MapperConfig.Feature.DEFAULT_VIEW_INCLUSION, false );
-//    objectMapper.getSerializationConfig( ).disable( SerializationConfig.Feature.DEFAULT_VIEW_INCLUSION );
+    objectMapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, false );
+//    objectMapper.getSerializationConfig( ).disable( SerializationConfig.SerializationFeature.DEFAULT_VIEW_INCLUSION );
 //    objectMapper.getSerializationConfig( ).setSerializationView( viewClass );
     return objectMapper;
   }
