diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 501bfd9732a0f4e1dc24a172ab2583083ee911e6..5ae5e7b6228eecf74e7ed1f4983f5c322a4c19cd 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,5 +1,6 @@
 3.1.0: generalized handling of "all" entities in geo file (using {:} notation);
-removed GModelFactory.
+removed GModelFactory, G{Edge,Face,Region}Compounds and old reparametrization
+code.
 
 3.0.6 (Novmeber 5, 2017): improved meshing of spheres; improved handling of mesh
 size constraints with OpenCASCADE kernel; implemented "Coherence" for
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8444a93bc12cc6fd7832d354a8362ee034b5ced6..3baa3075e59b1fe20916b6b72f1a71d5d3076b86 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,65 +108,65 @@ set(GMSH_INTERNAL_DEVELOPER_API
   ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshConfig.h
   ${CMAKE_CURRENT_BINARY_DIR}/Common/GmshVersion.h
   Common/GmshGlobal.h Common/Context.h Common/GmshDefines.h Common/GmshMessage.h
-    Common/VertexArray.h Common/Octree.h Common/OctreeInternals.h
-    Common/OS.h Common/StringUtils.h Common/OpenFile.h Common/Hash.h
-    Common/onelab.h Common/GmshSocket.h Common/onelabUtils.h Common/Options.h
-    Common/picojson.h
+    Common/VertexArray.h Common/Octree.h Common/OctreeInternals.h Common/OS.h
+    Common/StringUtils.h Common/OpenFile.h Common/Hash.h Common/onelab.h
+    Common/GmshSocket.h Common/onelabUtils.h Common/Options.h Common/picojson.h
   Numeric/Numeric.h Numeric/GaussIntegration.h Numeric/polynomialBasis.h
     Numeric/JacobianBasis.h Numeric/bezierBasis.h Numeric/fullMatrix.h
-    Numeric/FuncSpaceData.h Numeric/pointsGenerators.h
-    Numeric/simpleFunction.h Numeric/cartesian.h Numeric/ElementType.h
-    Numeric/BasisFactory.h Numeric/CondNumBasis.h
-  Geo/GModel.h Geo/GEntity.h Geo/GPoint.h Geo/GVertex.h Geo/GEdge.h
-    Geo/GFace.h Geo/GRegion.h Geo/GEdgeLoop.h Geo/GEdgeCompound.h
-    Geo/GFaceCompound.h Geo/GRegionCompound.h Geo/GRbf.h Geo/MVertex.h
-    Geo/MVertexBoundaryLayerData.h Geo/MEdge.h Geo/MFace.h
-    Geo/MEdgeHash.h Geo/MFaceHash.h
-    Geo/MElement.h Geo/MElementOctree.h Geo/MPoint.h Geo/MLine.h
-    Geo/MTriangle.h Geo/MQuadrangle.h Geo/MTetrahedron.h Geo/MHexahedron.h
-    Geo/MPrism.h Geo/MPyramid.h Geo/MTrihedron.h Geo/MElementCut.h
-    Geo/discreteVertex.h Geo/discreteEdge.h Geo/discreteFace.h Geo/discreteRegion.h
-    Geo/SPoint2.h Geo/SPoint3.h Geo/SVector3.h Geo/STensor3.h Geo/SBoundingBox3d.h
-    Geo/Pair.h Geo/Range.h Geo/SOrientedBoundingBox.h
-    Geo/CellComplex.h Geo/ChainComplex.h Geo/Cell.h Geo/Homology.h Geo/Chain.h
-    Geo/GenericVertex.h Geo/GenericEdge.h Geo/GenericFace.h Geo/GenericRegion.h
-    Geo/partitionVertex.h Geo/partitionEdge.h Geo/partitionFace.h Geo/CGNSOptions.h
-    Geo/gmshLevelset.h Geo/boundaryLayersData.h
+    Numeric/FuncSpaceData.h Numeric/pointsGenerators.h Numeric/simpleFunction.h
+    Numeric/cartesian.h Numeric/ElementType.h Numeric/BasisFactory.h
+    Numeric/CondNumBasis.h Numeric/mathEvaluator.h Numeric/nodalBasis.h
+  Geo/GModel.h Geo/GEntity.h Geo/GPoint.h Geo/GVertex.h Geo/GEdge.h Geo/GFace.h
+    Geo/GRegion.h Geo/GEdgeLoop.h Geo/MVertex.h Geo/MVertexBoundaryLayerData.h
+    Geo/MEdge.h Geo/MFace.h Geo/MEdgeHash.h Geo/MFaceHash.h Geo/MElement.h
+    Geo/MElementOctree.h Geo/MPoint.h Geo/MLine.h Geo/MTriangle.h
+    Geo/MQuadrangle.h Geo/MTetrahedron.h Geo/MHexahedron.h Geo/MPrism.h
+    Geo/MPyramid.h Geo/MTrihedron.h Geo/MElementCut.h Geo/discreteVertex.h
+    Geo/discreteEdge.h Geo/discreteFace.h Geo/discreteRegion.h Geo/SPoint2.h
+    Geo/SPoint3.h Geo/SVector3.h Geo/STensor3.h Geo/SBoundingBox3d.h Geo/Pair.h
+    Geo/Range.h Geo/SOrientedBoundingBox.h Geo/CellComplex.h Geo/ChainComplex.h
+    Geo/Cell.h Geo/Homology.h Geo/Chain.h Geo/GenericVertex.h Geo/GenericEdge.h
+    Geo/GenericFace.h Geo/GenericRegion.h Geo/partitionVertex.h
+    Geo/partitionEdge.h Geo/partitionFace.h Geo/CGNSOptions.h Geo/gmshLevelset.h
+    Geo/boundaryLayersData.h
   Mesh/meshGEdge.h Mesh/meshGFace.h Mesh/meshGFaceOptimize.h
-    Mesh/meshPartition.h Mesh/meshGFaceDelaunayInsertion.h
-    Mesh/simple3D.h Mesh/meshPartitionOptions.h Mesh/directions3D.h Mesh/yamakawa.h
+    Mesh/meshPartition.h Mesh/meshGFaceDelaunayInsertion.h Mesh/simple3D.h
+    Mesh/meshPartitionOptions.h Mesh/directions3D.h Mesh/yamakawa.h
     Mesh/Voronoi3D.h Mesh/Levy3D.h Mesh/meshMetric.h Mesh/ThinLayer.h
-  Numeric/mathEvaluator.h
-  Solver/dofManager.h Solver/femTerm.h Solver/laplaceTerm.h Solver/elasticityTerm.h
-    Solver/crossConfTerm.h Solver/orthogonalTerm.h
+  Solver/dofManager.h Solver/femTerm.h Solver/laplaceTerm.h
+    Solver/elasticityTerm.h Solver/crossConfTerm.h Solver/orthogonalTerm.h
     Solver/linearSystem.h Solver/linearSystemGMM.h Solver/linearSystemCSR.h
     Solver/linearSystemFull.h Solver/elasticitySolver.h Solver/sparsityPattern.h
-    Solver/groupOfElements.h Solver/linearSystemPETSc.h Solver/linearSystemMUMPS.h
-    Solver/thermicSolver.h
+    Solver/groupOfElements.h Solver/linearSystemPETSc.h
+    Solver/linearSystemMUMPS.h Solver/thermicSolver.h
   Post/PView.h Post/PViewData.h Plugin/PluginManager.h Post/OctreePost.h
-  Post/PViewDataList.h Post/PViewDataGModel.h Post/PViewOptions.h Post/ColorTable.h
-   Numeric/nodalBasis.h Post/adaptiveData.h
+    Post/PViewDataList.h Post/PViewDataGModel.h Post/PViewOptions.h
+    Post/ColorTable.h Post/adaptiveData.h
   Graphics/drawContext.h
   contrib/kbipack/gmp_normal_form.h contrib/kbipack/gmp_matrix.h
     contrib/kbipack/gmp_blas.h contrib/kbipack/mpz.h
   contrib/DiscreteIntegration/Integration3D.h
-  contrib/HighOrderMeshOptimizer/OptHOM.h contrib/HighOrderMeshOptimizer/OptHomMesh.h
-  contrib/HighOrderMeshOptimizer/OptHomRun.h contrib/HighOrderMeshOptimizer/ParamCoord.h
-  contrib/HighOrderMeshOptimizer/OptHomFastCurving.h
-  contrib/HighOrderMeshOptimizer/BoundaryLayerCurver.h
-  contrib/HighOrderMeshOptimizer/OptHomIntegralBoundaryDist.h
-  contrib/HighOrderMeshOptimizer/CADDistances.h
-  contrib/HighOrderMeshOptimizer/OptHomObjContribScaledJac.h
-  contrib/HighOrderMeshOptimizer/OptHomObjContribMetricMin.h
-  contrib/HighOrderMeshOptimizer/OptHomObjContribCADDist.h
+    contrib/HighOrderMeshOptimizer/OptHOM.h
+    contrib/HighOrderMeshOptimizer/OptHomMesh.h
+    contrib/HighOrderMeshOptimizer/OptHomRun.h
+    contrib/HighOrderMeshOptimizer/ParamCoord.h
+    contrib/HighOrderMeshOptimizer/OptHomFastCurving.h
+    contrib/HighOrderMeshOptimizer/BoundaryLayerCurver.h
+    contrib/HighOrderMeshOptimizer/OptHomIntegralBoundaryDist.h
+    contrib/HighOrderMeshOptimizer/CADDistances.h
+    contrib/HighOrderMeshOptimizer/OptHomObjContribScaledJac.h
+    contrib/HighOrderMeshOptimizer/OptHomObjContribMetricMin.h
+    contrib/HighOrderMeshOptimizer/OptHomObjContribCADDist.h
   contrib/MeshOptimizer/MeshOptPatch.h contrib/MeshOptimizer/MeshOpt.h
-  contrib/MeshOptimizer/MeshOptCommon.h contrib/MeshOptimizer/MeshOptimizer.h
-  contrib/MeshOptimizer/MeshOptObjContribFunc.h contrib/MeshOptimizer/MeshOptObjContrib.h
-  contrib/MeshOptimizer/MeshOptObjContribScaledNodeDispSq.h
-  contrib/MeshOptimizer/MeshOptObjectiveFunction.h contrib/MeshOptimizer/MeshOptVertexCoord.h
+    contrib/MeshOptimizer/MeshOptCommon.h contrib/MeshOptimizer/MeshOptimizer.h
+    contrib/MeshOptimizer/MeshOptObjContribFunc.h
+    contrib/MeshOptimizer/MeshOptObjContrib.h
+    contrib/MeshOptimizer/MeshOptObjContribScaledNodeDispSq.h
+    contrib/MeshOptimizer/MeshOptObjectiveFunction.h
+    contrib/MeshOptimizer/MeshOptVertexCoord.h
   contrib/MeshQualityOptimizer/MeshQualityObjContribIdealJac.h
-  contrib/MeshQualityOptimizer/MeshQualityObjContribInvCond.h
-  contrib/MeshQualityOptimizer/MeshQualityOptimizer.h
+    contrib/MeshQualityOptimizer/MeshQualityObjContribInvCond.h
+    contrib/MeshQualityOptimizer/MeshQualityOptimizer.h 
   contrib/MathEx/mathex.h)
 
 get_property(IAMCHILD DIRECTORY  PROPERTY PARENT_DIRECTORY)
@@ -1257,18 +1257,19 @@ if(ENABLE_WRAP_PYTHON)
   find_package(PythonLibs)
   if(SWIG_FOUND AND PYTHONLIBS_FOUND)
     message(STATUS "Found SWIG version " ${SWIG_VERSION})
-    if(NOT ENABLE_INTERNAL_DEVELOPER_API) # new bindings
-      include_directories(${PYTHON_INCLUDE_PATH})
-      include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-      set(CMAKE_SWIG_FLAGS "")
-      set_source_files_properties(Common/gmsh.i PROPERTIES CPLUSPLUS ON)
-      swig_add_module(gmsh python Common/gmsh.i)
-      swig_link_libraries(gmsh ${PYTHON_LIBRARIES} shared)
-      if(APPLE)
-        set_target_properties("_gmsh" PROPERTIES LINK_FLAGS
-                              "-undefined suppress -flat_namespace")
-      endif(APPLE)
-    else(NOT ENABLE_INTERNAL_DEVELOPER_API) # old, deprecated internal developer bindings
+    # stable API bindings
+    include_directories(${PYTHON_INCLUDE_PATH})
+    include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+    set(CMAKE_SWIG_FLAGS "")
+    set_source_files_properties(Common/gmsh.i PROPERTIES CPLUSPLUS ON)
+    swig_add_module(gmsh python Common/gmsh.i)
+    swig_link_libraries(gmsh ${PYTHON_LIBRARIES} shared)
+    if(APPLE)
+      set_target_properties("_gmsh" PROPERTIES LINK_FLAGS
+                            "-undefined suppress -flat_namespace")
+    endif(APPLE)
+    # internal developer API bindings
+    if(ENABLE_INTERNAL_DEVELOPER_API)
       find_package(PythonInterp)
       string(SUBSTRING ${SWIG_VERSION} 0 1 SWIG_MAJOR_VERSION)
       if(SWIG_MAJOR_VERSION EQUAL 1)
@@ -1303,7 +1304,7 @@ if(ENABLE_WRAP_PYTHON)
           endif(ENABLE_PETSC4PY)
         endif(HAVE_PETSC)
       endif(SWIG_MAJOR_VERSION EQUAL 1)
-    endif(NOT ENABLE_INTERNAL_DEVELOPER_API)
+    endif(ENABLE_INTERNAL_DEVELOPER_API)
   endif(SWIG_FOUND AND PYTHONLIBS_FOUND)
 endif(ENABLE_WRAP_PYTHON)
 
@@ -1934,9 +1935,9 @@ else(APPLE AND ENABLE_OS_SPECIFIC_INSTALL)
   set(CPACK_GENERATOR TGZ)
 endif(APPLE AND ENABLE_OS_SPECIFIC_INSTALL)
 
-if(HAVE_PYTHON AND ENABLE_INTERNAL_DEVELOPER_API)
+if(ENABLE_WRAP_PYTHON AND HAVE_PYTHON AND ENABLE_INTERNAL_DEVELOPER_API)
   add_subdirectory(wrappers/gmshpy)
-endif(HAVE_PYTHON AND ENABLE_INTERNAL_DEVELOPER_API)
+endif(ENABLE_WRAP_PYTHON AND HAVE_PYTHON AND ENABLE_INTERNAL_DEVELOPER_API)
 
 if(ENABLE_WRAP_JAVA AND ENABLE_INTERNAL_DEVELOPER_API)
   add_subdirectory(wrappers/java)
diff --git a/wrappers/gmshpy/CMakeLists.txt b/wrappers/gmshpy/CMakeLists.txt
index 32175f8d592aa3bf3bfba612a0cc44a6e25a047b..30a0009485468bf5015efb842dd4e2538ff6157c 100644
--- a/wrappers/gmshpy/CMakeLists.txt
+++ b/wrappers/gmshpy/CMakeLists.txt
@@ -151,7 +151,6 @@ if(ENABLE_GMSHPY_SOURCE_PACKAGE)
     Solver/eigenSolver.h
     Mesh/Generator.h
     Geo/GeomMeshMatcher.h
-    Geo/GFaceCompound.h
     Geo/gmshLevelset.h
     Numeric/jacobiPolynomials.h
     Numeric/legendrePolynomials.h
diff --git a/wrappers/gmshpy/gmshGeo.i b/wrappers/gmshpy/gmshGeo.i
index d0c5d734f48665eda9f681891e58feca514c2f24..37690f9489d3466707da952caeb1f21849198a39 100644
--- a/wrappers/gmshpy/gmshGeo.i
+++ b/wrappers/gmshpy/gmshGeo.i
@@ -12,14 +12,12 @@
   #include "GmshConfig.h"
 
   #include "GModel.h"
-  #include "GPoint.h"  
+  #include "GPoint.h"
   #include "GEntity.h"
   #include "GVertex.h"
   #include "GEdge.h"
   #include "GFace.h"
-  #include "GFaceCompound.h"
   #include "GRegion.h"
-  #include "GRegionCompound.h"
   #include "discreteFace.h"
   #include "discreteEdge.h"
   #include "discreteRegion.h"
@@ -43,7 +41,6 @@
   #include "SPoint3.h"
   #include "SPoint2.h"
   #include "SBoundingBox3d.h"
-  #include "Curvature.h"
   #include "simpleFunction.h"
   #include "GeomMeshMatcher.h"
 %}
@@ -104,7 +101,7 @@ namespace std {
 %ignore GPoint::x();
 %ignore GPoint::y();
 %ignore GPoint::z();
-%include "GPoint.h"  
+%include "GPoint.h"
 %include "GEntity.h"
 %include "GVertex.h"
 %apply std::vector<double> &OUTPUT{std::vector<double> &ts}
@@ -112,9 +109,7 @@ namespace std {
 %include "GEdge.h"
 %ignore GFace::computeMeanPlane(std::vector< MVertex *>const&);
 %include "GFace.h"
-%include "GFaceCompound.h"
 %include "GRegion.h"
-%include "GRegionCompound.h"
 %include "discreteFace.h"
 %include "discreteEdge.h"
 %include "discreteVertex.h"
@@ -146,7 +141,6 @@ namespace std {
 %include "SVector3.h"
 %include "SPoint2.h"
 %include "SBoundingBox3d.h"
-%include "Curvature.h"
 %include "gmshLevelset.h"
 %include "GeomMeshMatcher.h"