Index: src/SymTab/Indexer.cc
===================================================================
--- src/SymTab/Indexer.cc	(revision 79de2210c8863a3cdcf96bdb85b53eb25fd7baca)
+++ src/SymTab/Indexer.cc	(revision 1cb7fab24a9d8ae701d8295e3857478969f5fd45)
@@ -45,14 +45,36 @@
 	// Statistics block
 	namespace {
-		auto idtable_group = new Stats::Counters::CounterGroup("IdTable");
-		auto idtable_find  = new Stats::Counters::SimpleCounter("Find calls", idtable_group);
-		auto idtable_size  = new Stats::Counters::AverageCounter<double>("Average Size", idtable_group);
-		auto idtable_key   = new Stats::Counters::AverageCounter<double>("Average Key Size", idtable_group);
-
-		auto indexers_group = new Stats::Counters::CounterGroup("Indexers");
-		auto indexers_count = new Stats::Counters::SimpleCounter("Count", indexers_group);
-		auto indexers_size  = new Stats::Counters::AverageCounter<double>("Average Size", indexers_group);
-		auto indexers_depth_a  = new Stats::Counters::AverageCounter<double>("Average Depth", indexers_group);
-		auto indexers_depth_m  = new Stats::Counters::MaxCounter<size_t>("Max Depth", indexers_group);
+
+		static inline auto stats_idtable() {
+			using namespace Stats::Counters;
+			static auto group = build<CounterGroup>("IdTable");
+			static struct {
+				SimpleCounter * find;
+				AverageCounter<double> * size;
+				AverageCounter<double> * key;
+			} ret = {
+				.find = build<SimpleCounter>("Find calls", group),
+				.size = build<AverageCounter<double>>("Average Size", group),
+				.key  = build<AverageCounter<double>>("Average Key Size", group),
+			};
+			return ret;
+		}
+
+		static inline auto stats_indexers() {
+			using namespace Stats::Counters;
+			static auto group   = build<CounterGroup>("Indexers");
+			static struct {
+				SimpleCounter * count;
+				AverageCounter<double> * size;
+				AverageCounter<double> * depth_a;
+				MaxCounter<size_t> * depth_m;
+			} ret = {
+				.count   = build<SimpleCounter>("Count", group),
+				.size    = build<AverageCounter<double>>("Average Size", group),
+				.depth_a = build<AverageCounter<double>>("Average Depth", group),
+				.depth_m = build<MaxCounter<size_t>>("Max Depth", group),
+			};
+			return ret;
+		}
 	}
 
@@ -214,9 +236,9 @@
 
 	Indexer::Indexer() : tables( 0 ), scope( 0 ) {
-		(*indexers_count)++;
+		(*stats_indexers().count)++;
 	}
 
 	Indexer::Indexer( const Indexer &that ) : doDebug( that.doDebug ), tables( newRef( that.tables ) ), scope( that.scope ) {
-		(*indexers_count)++;
+		(*stats_indexers().count)++;
 	}
 
@@ -227,11 +249,11 @@
 	Indexer::~Indexer() {
 		if(tables) {
-			indexers_size->push( tables->idTable.size() );
+			stats_indexers().size->push( tables->idTable.size() );
 			size_t depth = 1;
 			for( auto crnt = tables->base.tables; crnt; crnt = crnt->base.tables ) {
 				++depth;
 			}
-			indexers_depth_a->push( depth );
-			indexers_depth_m->push( depth );
+			stats_indexers().depth_a->push( depth );
+			stats_indexers().depth_m->push( depth );
 		}
 		deleteRef( tables );
@@ -266,7 +288,7 @@
 		while ( searchTables ) {
 
-			(*idtable_find)++;
-			idtable_key->push( id.size() );
-			idtable_size->push( searchTables->idTable.size() );
+			(*stats_idtable().find)++;
+			stats_idtable().key->push( id.size() );
+			stats_idtable().size->push( searchTables->idTable.size() );
 			IdTable::const_iterator decls = searchTables->idTable.find( id );
 			if ( decls != searchTables->idTable.end() ) {
@@ -345,7 +367,7 @@
 		if ( tables->scope < scope ) return nullptr;
 
-		(*idtable_find)++;
-		idtable_key->push( id.size() );
-		idtable_size->push( tables->idTable.size() );
+		(*stats_idtable().find)++;
+		stats_idtable().key->push( id.size() );
+		stats_idtable().size->push( tables->idTable.size() );
 		IdTable::const_iterator decls = tables->idTable.find( id );
 		if ( decls != tables->idTable.end() ) {
@@ -366,7 +388,7 @@
 		if ( tables->scope < scope ) return false;
 
-		(*idtable_find)++;
-		idtable_key->push( id.size() );
-		idtable_size->push( tables->idTable.size() );
+		(*stats_idtable().find)++;
+		stats_idtable().key->push( id.size() );
+		stats_idtable().size->push( tables->idTable.size() );
 		IdTable::const_iterator decls = tables->idTable.find( id );
 		if ( decls != tables->idTable.end() ) {
@@ -385,7 +407,7 @@
 		if ( tables->scope < scope ) return false;
 
-		(*idtable_find)++;
-		idtable_key->push( id.size() );
-		idtable_size->push( tables->idTable.size() );
+		(*stats_idtable().find)++;
+		stats_idtable().key->push( id.size() );
+		stats_idtable().size->push( tables->idTable.size() );
 		IdTable::const_iterator decls = tables->idTable.find( id );
 		if ( decls != tables->idTable.end() ) {
