diff --git a/src/main/java/com/hubspot/jinjava/interpret/Context.java b/src/main/java/com/hubspot/jinjava/interpret/Context.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/hubspot/jinjava/interpret/Context.java
+++ b/src/main/java/com/hubspot/jinjava/interpret/Context.java
@@ -319,29 +319,10 @@ public class Context extends ScopeMap<String, Object> {
   }
 
   public void addDependency(String type, String identification) {
-    Context highestParentContext = getHighestParentContext();
-    highestParentContext.dependencies.get(type).add(identification);
+    this.dependencies.get(type).add(identification);
   }
 
   public SetMultimap<String, String> getDependencies() {
-    Context highestParentContext = getHighestParentContext();
-    return highestParentContext.dependencies;
+    return this.dependencies;
   }
-
-  private Context getHighestParentContext() {
-    Context highestParentContext = parent != null ? parent : this;
-    Context currentParentContext = highestParentContext.getParent();
-
-    while (currentParentContext != null) {
-      if (currentParentContext.equals(currentParentContext.getParent())) {
-        return highestParentContext;
-      }
-
-      highestParentContext = highestParentContext.getParent();
-      currentParentContext = highestParentContext.getParent();
-
-    }
-    return highestParentContext;
-  }
-
 }
Stop iterating too high up the Context