Index: lemon/bits/array_map.h
===================================================================
--- lemon/bits/array_map.h	(revision 503)
+++ lemon/bits/array_map.h	(revision 617)
@@ -48,5 +48,5 @@
   public:
     // The graph type.
-    typedef _Graph Graph;
+    typedef _Graph GraphType;
     // The item type.
     typedef _Item Item;
@@ -64,11 +64,15 @@
     typedef _Value& Reference;
 
+    // The map type.
+    typedef ArrayMap Map;
+
     // The notifier type.
     typedef typename ItemSetTraits<_Graph, _Item>::ItemNotifier Notifier;
 
+  private:
+  
     // The MapBase of the Map which imlements the core regisitry function.
     typedef typename Notifier::ObserverBase Parent;
 
-  private:
     typedef std::allocator<Value> Allocator;
 
@@ -78,5 +82,5 @@
     //
     // Graph initialized map constructor.
-    explicit ArrayMap(const Graph& graph) {
+    explicit ArrayMap(const GraphType& graph) {
       Parent::attach(graph.notifier(Item()));
       allocate_memory();
@@ -92,5 +96,5 @@
     //
     // It constructs a map and initialize all of the the map.
-    ArrayMap(const Graph& graph, const Value& value) {
+    ArrayMap(const GraphType& graph, const Value& value) {
       Parent::attach(graph.notifier(Item()));
       allocate_memory();
Index: lemon/bits/base_extender.h
===================================================================
--- lemon/bits/base_extender.h	(revision 440)
+++ lemon/bits/base_extender.h	(revision 617)
@@ -39,8 +39,8 @@
   template <typename Base>
   class UndirDigraphExtender : public Base {
+    typedef Base Parent;
 
   public:
 
-    typedef Base Parent;
     typedef typename Parent::Arc Edge;
     typedef typename Parent::Node Node;
@@ -281,6 +281,7 @@
   template <typename Base>
   class BidirBpGraphExtender : public Base {
+    typedef Base Parent;
+
   public:
-    typedef Base Parent;
     typedef BidirBpGraphExtender Digraph;
 
Index: lemon/bits/default_map.h
===================================================================
--- lemon/bits/default_map.h	(revision 535)
+++ lemon/bits/default_map.h	(revision 617)
@@ -154,13 +154,14 @@
   class DefaultMap
     : public DefaultMapSelector<_Graph, _Item, _Value>::Map {
+    typedef typename DefaultMapSelector<_Graph, _Item, _Value>::Map Parent;
+
   public:
-    typedef typename DefaultMapSelector<_Graph, _Item, _Value>::Map Parent;
     typedef DefaultMap<_Graph, _Item, _Value> Map;
-
-    typedef typename Parent::Graph Graph;
+    
+    typedef typename Parent::GraphType GraphType;
     typedef typename Parent::Value Value;
 
-    explicit DefaultMap(const Graph& graph) : Parent(graph) {}
-    DefaultMap(const Graph& graph, const Value& value)
+    explicit DefaultMap(const GraphType& graph) : Parent(graph) {}
+    DefaultMap(const GraphType& graph, const Value& value)
       : Parent(graph, value) {}
 
Index: lemon/bits/edge_set_extender.h
===================================================================
--- lemon/bits/edge_set_extender.h	(revision 559)
+++ lemon/bits/edge_set_extender.h	(revision 617)
@@ -35,7 +35,8 @@
   template <typename Base>
   class ArcSetExtender : public Base {
+    typedef Base Parent;
+
   public:
 
-    typedef Base Parent;
     typedef ArcSetExtender Digraph;
 
@@ -219,8 +220,7 @@
     class ArcMap 
       : public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
-    public:
-      typedef ArcSetExtender Digraph;
       typedef MapExtender<DefaultMap<Digraph, Arc, _Value> > Parent;
 
+    public:
       explicit ArcMap(const Digraph& _g) 
 	: Parent(_g) {}
@@ -275,14 +275,13 @@
   template <typename Base>
   class EdgeSetExtender : public Base {
+    typedef Base Parent;
 
   public:
 
-    typedef Base Parent;
-    typedef EdgeSetExtender Digraph;
+    typedef EdgeSetExtender Graph;
 
     typedef typename Parent::Node Node;
     typedef typename Parent::Arc Arc;
     typedef typename Parent::Edge Edge;
-
 
     int maxId(Node) const {
@@ -351,5 +350,5 @@
 
     class NodeIt : public Node { 
-      const Digraph* digraph;
+      const Graph* graph;
     public:
 
@@ -358,13 +357,13 @@
       NodeIt(Invalid i) : Node(i) { }
 
-      explicit NodeIt(const Digraph& _graph) : digraph(&_graph) {
+      explicit NodeIt(const Graph& _graph) : graph(&_graph) {
 	_graph.first(static_cast<Node&>(*this));
       }
 
-      NodeIt(const Digraph& _graph, const Node& node) 
-	: Node(node), digraph(&_graph) {}
+      NodeIt(const Graph& _graph, const Node& node) 
+	: Node(node), graph(&_graph) {}
 
       NodeIt& operator++() { 
-	digraph->next(*this);
+	graph->next(*this);
 	return *this; 
       }
@@ -374,5 +373,5 @@
 
     class ArcIt : public Arc { 
-      const Digraph* digraph;
+      const Graph* graph;
     public:
 
@@ -381,13 +380,13 @@
       ArcIt(Invalid i) : Arc(i) { }
 
-      explicit ArcIt(const Digraph& _graph) : digraph(&_graph) {
+      explicit ArcIt(const Graph& _graph) : graph(&_graph) {
 	_graph.first(static_cast<Arc&>(*this));
       }
 
-      ArcIt(const Digraph& _graph, const Arc& e) : 
-	Arc(e), digraph(&_graph) { }
+      ArcIt(const Graph& _graph, const Arc& e) : 
+	Arc(e), graph(&_graph) { }
 
       ArcIt& operator++() { 
-	digraph->next(*this);
+	graph->next(*this);
 	return *this; 
       }
@@ -397,5 +396,5 @@
 
     class OutArcIt : public Arc { 
-      const Digraph* digraph;
+      const Graph* graph;
     public:
 
@@ -404,14 +403,14 @@
       OutArcIt(Invalid i) : Arc(i) { }
 
-      OutArcIt(const Digraph& _graph, const Node& node) 
-	: digraph(&_graph) {
+      OutArcIt(const Graph& _graph, const Node& node) 
+	: graph(&_graph) {
 	_graph.firstOut(*this, node);
       }
 
-      OutArcIt(const Digraph& _graph, const Arc& arc) 
-	: Arc(arc), digraph(&_graph) {}
+      OutArcIt(const Graph& _graph, const Arc& arc) 
+	: Arc(arc), graph(&_graph) {}
 
       OutArcIt& operator++() { 
-	digraph->nextOut(*this);
+	graph->nextOut(*this);
 	return *this; 
       }
@@ -421,5 +420,5 @@
 
     class InArcIt : public Arc { 
-      const Digraph* digraph;
+      const Graph* graph;
     public:
 
@@ -428,14 +427,14 @@
       InArcIt(Invalid i) : Arc(i) { }
 
-      InArcIt(const Digraph& _graph, const Node& node) 
-	: digraph(&_graph) {
+      InArcIt(const Graph& _graph, const Node& node) 
+	: graph(&_graph) {
 	_graph.firstIn(*this, node);
       }
 
-      InArcIt(const Digraph& _graph, const Arc& arc) : 
-	Arc(arc), digraph(&_graph) {}
+      InArcIt(const Graph& _graph, const Arc& arc) : 
+	Arc(arc), graph(&_graph) {}
 
       InArcIt& operator++() { 
-	digraph->nextIn(*this);
+	graph->nextIn(*this);
 	return *this; 
       }
@@ -445,5 +444,5 @@
 
     class EdgeIt : public Parent::Edge { 
-      const Digraph* digraph;
+      const Graph* graph;
     public:
 
@@ -452,13 +451,13 @@
       EdgeIt(Invalid i) : Edge(i) { }
 
-      explicit EdgeIt(const Digraph& _graph) : digraph(&_graph) {
+      explicit EdgeIt(const Graph& _graph) : graph(&_graph) {
 	_graph.first(static_cast<Edge&>(*this));
       }
 
-      EdgeIt(const Digraph& _graph, const Edge& e) : 
-	Edge(e), digraph(&_graph) { }
+      EdgeIt(const Graph& _graph, const Edge& e) : 
+	Edge(e), graph(&_graph) { }
 
       EdgeIt& operator++() { 
-	digraph->next(*this);
+	graph->next(*this);
 	return *this; 
       }
@@ -468,5 +467,5 @@
     class IncEdgeIt : public Parent::Edge {
       friend class EdgeSetExtender;
-      const Digraph* digraph;
+      const Graph* graph;
       bool direction;
     public:
@@ -476,15 +475,15 @@
       IncEdgeIt(Invalid i) : Edge(i), direction(false) { }
 
-      IncEdgeIt(const Digraph& _graph, const Node &n) : digraph(&_graph) {
+      IncEdgeIt(const Graph& _graph, const Node &n) : graph(&_graph) {
 	_graph.firstInc(*this, direction, n);
       }
 
-      IncEdgeIt(const Digraph& _graph, const Edge &ue, const Node &n)
-	: digraph(&_graph), Edge(ue) {
+      IncEdgeIt(const Graph& _graph, const Edge &ue, const Node &n)
+	: graph(&_graph), Edge(ue) {
 	direction = (_graph.source(ue) == n);
       }
 
       IncEdgeIt& operator++() {
-	digraph->nextInc(*this, direction);
+	graph->nextInc(*this, direction);
 	return *this; 
       }
@@ -535,12 +534,11 @@
     template <typename _Value>
     class ArcMap 
-      : public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
-    public:
-      typedef EdgeSetExtender Digraph;
-      typedef MapExtender<DefaultMap<Digraph, Arc, _Value> > Parent;
-
-      ArcMap(const Digraph& _g) 
+      : public MapExtender<DefaultMap<Graph, Arc, _Value> > {
+      typedef MapExtender<DefaultMap<Graph, Arc, _Value> > Parent;
+
+    public:
+      ArcMap(const Graph& _g) 
 	: Parent(_g) {}
-      ArcMap(const Digraph& _g, const _Value& _v) 
+      ArcMap(const Graph& _g, const _Value& _v) 
 	: Parent(_g, _v) {}
 
@@ -560,13 +558,12 @@
     template <typename _Value>
     class EdgeMap 
-      : public MapExtender<DefaultMap<Digraph, Edge, _Value> > {
-    public:
-      typedef EdgeSetExtender Digraph;
-      typedef MapExtender<DefaultMap<Digraph, Edge, _Value> > Parent;
-
-      EdgeMap(const Digraph& _g) 
+      : public MapExtender<DefaultMap<Graph, Edge, _Value> > {
+      typedef MapExtender<DefaultMap<Graph, Edge, _Value> > Parent;
+
+    public:
+      EdgeMap(const Graph& _g) 
 	: Parent(_g) {}
 
-      EdgeMap(const Digraph& _g, const _Value& _v) 
+      EdgeMap(const Graph& _g, const _Value& _v) 
 	: Parent(_g, _v) {}
 
Index: lemon/bits/graph_adaptor_extender.h
===================================================================
--- lemon/bits/graph_adaptor_extender.h	(revision 580)
+++ lemon/bits/graph_adaptor_extender.h	(revision 617)
@@ -27,7 +27,8 @@
   template <typename _Digraph>
   class DigraphAdaptorExtender : public _Digraph {
+    typedef _Digraph Parent;
+
   public:
 
-    typedef _Digraph Parent;
     typedef _Digraph Digraph;
     typedef DigraphAdaptorExtender Adaptor;
@@ -174,7 +175,8 @@
   template <typename _Graph>
   class GraphAdaptorExtender : public _Graph {
+    typedef _Graph Parent;
+
   public:
 
-    typedef _Graph Parent;
     typedef _Graph Graph;
     typedef GraphAdaptorExtender Adaptor;
Index: lemon/bits/graph_extender.h
===================================================================
--- lemon/bits/graph_extender.h	(revision 440)
+++ lemon/bits/graph_extender.h	(revision 617)
@@ -38,7 +38,8 @@
   template <typename Base>
   class DigraphExtender : public Base {
+    typedef Base Parent;
+
   public:
 
-    typedef Base Parent;
     typedef DigraphExtender Digraph;
 
@@ -219,8 +220,7 @@
     class NodeMap
       : public MapExtender<DefaultMap<Digraph, Node, _Value> > {
-    public:
-      typedef DigraphExtender Digraph;
       typedef MapExtender<DefaultMap<Digraph, Node, _Value> > Parent;
 
+    public:
       explicit NodeMap(const Digraph& digraph)
         : Parent(digraph) {}
@@ -244,8 +244,7 @@
     class ArcMap
       : public MapExtender<DefaultMap<Digraph, Arc, _Value> > {
-    public:
-      typedef DigraphExtender Digraph;
       typedef MapExtender<DefaultMap<Digraph, Arc, _Value> > Parent;
 
+    public:
       explicit ArcMap(const Digraph& digraph)
         : Parent(digraph) {}
@@ -331,7 +330,8 @@
   template <typename Base>
   class GraphExtender : public Base {
+    typedef Base Parent;
+
   public:
 
-    typedef Base Parent;
     typedef GraphExtender Graph;
 
@@ -602,8 +602,7 @@
     class NodeMap
       : public MapExtender<DefaultMap<Graph, Node, _Value> > {
-    public:
-      typedef GraphExtender Graph;
       typedef MapExtender<DefaultMap<Graph, Node, _Value> > Parent;
 
+    public:
       NodeMap(const Graph& graph)
         : Parent(graph) {}
@@ -627,8 +626,7 @@
     class ArcMap
       : public MapExtender<DefaultMap<Graph, Arc, _Value> > {
-    public:
-      typedef GraphExtender Graph;
       typedef MapExtender<DefaultMap<Graph, Arc, _Value> > Parent;
 
+    public:
       ArcMap(const Graph& graph)
         : Parent(graph) {}
@@ -652,8 +650,7 @@
     class EdgeMap
       : public MapExtender<DefaultMap<Graph, Edge, _Value> > {
-    public:
-      typedef GraphExtender Graph;
       typedef MapExtender<DefaultMap<Graph, Edge, _Value> > Parent;
 
+    public:
       EdgeMap(const Graph& graph)
         : Parent(graph) {}
Index: lemon/bits/map_extender.h
===================================================================
--- lemon/bits/map_extender.h	(revision 580)
+++ lemon/bits/map_extender.h	(revision 617)
@@ -37,11 +37,10 @@
   template <typename _Map>
   class MapExtender : public _Map {
-  public:
-
     typedef _Map Parent;
+    typedef typename Parent::GraphType GraphType;
+
+  public:
+
     typedef MapExtender Map;
-
-
-    typedef typename Parent::Graph Graph;
     typedef typename Parent::Key Item;
 
@@ -59,8 +58,8 @@
   public:
 
-    MapExtender(const Graph& graph)
+    MapExtender(const GraphType& graph)
       : Parent(graph) {}
 
-    MapExtender(const Graph& graph, const Value& value)
+    MapExtender(const GraphType& graph, const Value& value)
       : Parent(graph, value) {}
 
@@ -78,7 +77,8 @@
   public:
     class MapIt : public Item {
-    public:
-
-      typedef Item Parent;
+      typedef Item Parent;
+
+    public:
+
       typedef typename Map::Value Value;
 
@@ -117,7 +117,7 @@
 
     class ConstMapIt : public Item {
-    public:
-
-      typedef Item Parent;
+      typedef Item Parent;
+
+    public:
 
       typedef typename Map::Value Value;
@@ -148,7 +148,7 @@
 
     class ItemIt : public Item {
-    public:
-
-      typedef Item Parent;
+      typedef Item Parent;
+
+    public:
 
       ItemIt() {}
@@ -179,11 +179,10 @@
   template <typename _Graph, typename _Map>
   class SubMapExtender : public _Map {
-  public:
-
     typedef _Map Parent;
+    typedef _Graph GraphType;
+
+  public:
+
     typedef SubMapExtender Map;
-
-    typedef _Graph Graph;
-
     typedef typename Parent::Key Item;
 
@@ -201,8 +200,8 @@
   public:
 
-    SubMapExtender(const Graph& _graph)
+    SubMapExtender(const GraphType& _graph)
       : Parent(_graph), graph(_graph) {}
 
-    SubMapExtender(const Graph& _graph, const Value& _value)
+    SubMapExtender(const GraphType& _graph, const Value& _value)
       : Parent(_graph, _value), graph(_graph) {}
 
@@ -224,7 +223,7 @@
   public:
     class MapIt : public Item {
-    public:
-
-      typedef Item Parent;
+      typedef Item Parent;
+
+    public:
       typedef typename Map::Value Value;
 
@@ -263,7 +262,7 @@
 
     class ConstMapIt : public Item {
-    public:
-
-      typedef Item Parent;
+      typedef Item Parent;
+
+    public:
 
       typedef typename Map::Value Value;
@@ -294,7 +293,7 @@
 
     class ItemIt : public Item {
-    public:
-
-      typedef Item Parent;
+      typedef Item Parent;
+
+    public:
 
       ItemIt() {}
@@ -321,5 +320,5 @@
   private:
 
-    const Graph& graph;
+    const GraphType& graph;
 
   };
Index: lemon/bits/vector_map.h
===================================================================
--- lemon/bits/vector_map.h	(revision 503)
+++ lemon/bits/vector_map.h	(revision 617)
@@ -57,5 +57,5 @@
 
     // The graph type of the map.
-    typedef _Graph Graph;
+    typedef _Graph GraphType;
     // The item type of the map.
     typedef _Item Item;
@@ -73,6 +73,4 @@
     // The map type.
     typedef VectorMap Map;
-    // The base class of the map.
-    typedef typename Notifier::ObserverBase Parent;
 
     // The reference type of the map;
@@ -81,4 +79,10 @@
     typedef typename Container::const_reference ConstReference;
 
+  private:
+
+    // The base class of the map.
+    typedef typename Notifier::ObserverBase Parent;
+
+  public:
 
     // \brief Constructor to attach the new map into the notifier.
@@ -86,5 +90,5 @@
     // It constructs a map and attachs it into the notifier.
     // It adds all the items of the graph to the map.
-    VectorMap(const Graph& graph) {
+    VectorMap(const GraphType& graph) {
       Parent::attach(graph.notifier(Item()));
       container.resize(Parent::notifier()->maxId() + 1);
@@ -95,5 +99,5 @@
     // It constructs a map uses a given value to initialize the map.
     // It adds all the items of the graph to the map.
-    VectorMap(const Graph& graph, const Value& value) {
+    VectorMap(const GraphType& graph, const Value& value) {
       Parent::attach(graph.notifier(Item()));
       container.resize(Parent::notifier()->maxId() + 1, value);
