     strip-word-names? [ dup strip-word-names ] when
     2drop ;
 
+: compiler-classes ( -- seq )
+    { "compiler" "stack-checker" }
+    [ child-vocabs [ words ] map concat [ class? ] filter ]
+    map concat unique ;
+
+: prune-decision-tree ( tree classes -- )
+    [ tuple class>type ] 2dip '[
+        dup array? [
+            [
+                dup array? [
+                    [
+                        2 group
+                        [ drop _ key? not ] assoc-filter
+                        concat
+                    ] map
+                ] when
+            ] map
+        ] when
+    ] change-nth ;
+
 : strip-compiler-classes ( -- )
     strip-dictionary? [
         "Stripping compiler classes" show
-        { "compiler" "stack-checker" }
-        [ child-vocabs [ words ] map concat [ class? ] filter ] map concat
-        [ dup implementors [ "methods" word-prop delete-at ] with each ] each
+        [ single-generic? ] instances
+        compiler-classes '[ "decision-tree" word-prop _ prune-decision-tree ] each
     ] when ;
 
 : recursive-subst ( seq old new -- )

    "vocab:tools/deploy/shaker/next-methods.factor" run-file ;

: (clear-megamorphic-cache) ( i array -- )
    2dup 1 slot < [
        2dup [ f ] 2dip set-array-nth
        [ 1 + ] dip (clear-megamorphic-cache)

    compute-next-methods
    strip-init-hooks
    strip-c-io
    strip-default-methods
    strip-compiler-classes
    f 5 setenv ! we can't use the Factor debugger or Factor I/O anymore
    deploy-vocab get vocab-main deploy-boot-quot
    find-megamorphic-caches
