diff --git a/reclass/storage/memcache_proxy.py b/reclass/storage/memcache_proxy.py
index a709d40..485024b 100644
--- a/reclass/storage/memcache_proxy.py
+++ b/reclass/storage/memcache_proxy.py
@@ -14,7 +14,7 @@
 class MemcacheProxy(NodeStorageBase):
 
     def __init__(self, real_storage, cache_classes=True, cache_nodes=True,
-                 cache_nodelist=True, cache_exports=True):
+                 cache_nodelist=True):
         name = '{0}({1})'.format(STORAGE_NAME, real_storage.name)
         super(MemcacheProxy, self).__init__(name)
         self._real_storage = real_storage
@@ -27,50 +27,28 @@
         self._cache_nodelist = cache_nodelist
         if cache_nodelist:
             self._nodelist_cache = None
-        self._cache_exports = cache_exports
-        if cache_exports:
-            self._exports_cache = None
 
     name = property(lambda self: self._real_storage.name)
 
-    @staticmethod
-    def _cache_proxy(name, cache, getter):
-        try:
-            ret = cache[name]
-
-        except KeyError, e:
-            ret = getter(name)
-            cache[name] = ret
-
-        return ret
-
-    @staticmethod
-    def _cache(cache, getter):
-        if cache is None:
-            cache = getter()
-        return cache
-
     def get_node(self, name):
         if not self._cache_nodes:
             return self._real_storage.get_node(name)
-
-        return MemcacheProxy._cache_proxy(name, self._nodes_cache,
-                                          self._real_storage.get_node)
+        try:
+            ret = self._nodes_cache[name]
+        except KeyError, e:
+            ret = self._real_storage.get_node(name)
+            self._nodes_cache[name] = ret
+        return ret
 
     def get_class(self, name, environment):
         if not self._cache_classes:
             return self._real_storage.get_class(name, environment)
-
-        return MemcacheProxy._cache_proxy(name, self._classes_cache,
-                                          self._real_storage.get_class)
-
-    def get_exports(self):
-        if not self._cache_exports:
-             return self._real_storage.get_exports()
-        return MemcacheProxy._cache(self._exports_cache, self._real_storage.get_exports)
-
-    def put_exports(self, new):
-        self._real_storage.put_exports(new)
+        try:
+            ret = self._classes_cache[name]
+        except KeyError, e:
+            ret = self._real_storage.get_class(name, environment)
+            self._classes_cache[name] = ret
+        return ret
 
     def enumerate_nodes(self):
         if not self._cache_nodelist:
diff --git a/reclass/storage/mixed/__init__.py b/reclass/storage/mixed/__init__.py
index 238ce74..1fc4fb5 100644
--- a/reclass/storage/mixed/__init__.py
+++ b/reclass/storage/mixed/__init__.py
@@ -50,7 +50,7 @@
     def get_node(self, name):
         return self._nodes_storage.get_node(name)
 
-    def get_class(self, name, environment=None):
+    def get_class(self, name, environment):
         if environment is None:
             storage = self._classes_default_storage
         else:
diff --git a/reclass/storage/tests/test_memcache_proxy.py b/reclass/storage/tests/test_memcache_proxy.py
index 066c27e..6764251 100644
--- a/reclass/storage/tests/test_memcache_proxy.py
+++ b/reclass/storage/tests/test_memcache_proxy.py
@@ -47,23 +47,23 @@
         p = MemcacheProxy(self._storage, cache_classes=False)
         NAME = 'foo'; NAME2 = 'bar'; RET = 'baz'
         self._storage.get_class.return_value = RET
-        self.assertEqual(p.get_class(NAME), RET)
-        self.assertEqual(p.get_class(NAME), RET)
-        self.assertEqual(p.get_class(NAME2), RET)
-        self.assertEqual(p.get_class(NAME2), RET)
-        expected = [mock.call(NAME), mock.call(NAME),
-                    mock.call(NAME2), mock.call(NAME2)]
+        self.assertEqual(p.get_class(NAME, None), RET)
+        self.assertEqual(p.get_class(NAME, None), RET)
+        self.assertEqual(p.get_class(NAME2, None), RET)
+        self.assertEqual(p.get_class(NAME2, None), RET)
+        expected = [mock.call(NAME, None), mock.call(NAME, None),
+                    mock.call(NAME2, None), mock.call(NAME2, None)]
         self.assertListEqual(self._storage.get_class.call_args_list, expected)
 
     def test_classes_caching(self):
         p = MemcacheProxy(self._storage, cache_classes=True)
         NAME = 'foo'; NAME2 = 'bar'; RET = 'baz'
         self._storage.get_class.return_value = RET
-        self.assertEqual(p.get_class(NAME), RET)
-        self.assertEqual(p.get_class(NAME), RET)
-        self.assertEqual(p.get_class(NAME2), RET)
-        self.assertEqual(p.get_class(NAME2), RET)
-        expected = [mock.call(NAME), mock.call(NAME2)] # called once each
+        self.assertEqual(p.get_class(NAME, None), RET)
+        self.assertEqual(p.get_class(NAME, None), RET)
+        self.assertEqual(p.get_class(NAME2, None), RET)
+        self.assertEqual(p.get_class(NAME2, None), RET)
+        expected = [mock.call(NAME, None), mock.call(NAME2, None)] # called once each
         self.assertListEqual(self._storage.get_class.call_args_list, expected)
 
     def test_nodelist_no_caching(self):
diff --git a/reclass/storage/yaml_git/__init__.py b/reclass/storage/yaml_git/__init__.py
index cd85ed1..b08d4f9 100644
--- a/reclass/storage/yaml_git/__init__.py
+++ b/reclass/storage/yaml_git/__init__.py
@@ -136,7 +136,7 @@
         entity = YamlData.from_string(blob.data, 'git_fs://{0}#{1}/{2}'.format(self._nodes_uri.repo, self._nodes_uri.branch, file.path)).get_entity(name)
         return entity
 
-    def get_class(self, name, environment=None):
+    def get_class(self, name, environment):
         uri = self._env_to_uri(environment)
         file = self._repos[uri.repo].files[uri.branch][name]
         blob = self._repos[uri.repo].get(file.id)
@@ -151,12 +151,16 @@
             self._repos[url] = GitRepo(url)
 
     def _env_to_uri(self, environment):
+        ret = None
         if environment is None:
             ret = self._classes_default_uri
-        for env, uri in self._classes_uri:
-            if env == environment:
-                ret = uri
-                break
+        else:
+            for env, uri in self._classes_uri:
+                if env == environment:
+                    ret = uri
+                    break
+        if ret is None:
+            ret = self._classes_default_uri
         if ret.branch == '__env__':
             ret.branch = environment
         if ret.branch == None:
