diff --git a/Doc/Sd1/Collections/collections.xml b/Doc/Sd1/Collections/collections.xml
index 0e607adea84e0d501b1f544c20b2e9c068e08180..70044ed577b58ff9fcca89c5c00671157dfd3117 100644
--- a/Doc/Sd1/Collections/collections.xml
+++ b/Doc/Sd1/Collections/collections.xml
@@ -2,6 +2,7 @@
 <chapter version="5.1" xml:id="sd1Collection1"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
          xmlns:xi="http://www.w3.org/2001/XInclude"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:ns="http://docbook.org/ns/transclusion"
@@ -279,9 +280,9 @@ c12.equals("dummy"):false
 
   @Override
   public boolean equals(Object obj) {
-    if (obj instanceof Coordinate) {
-      return x == ((Coordinate)obj).x &amp;&amp;
-          y == ((Coordinate)obj).y;
+    if (obj instanceof Coordinate <emphasis role="red">c</emphasis>) {
+      return x == <emphasis role="red">c</emphasis>.x &amp;&amp;
+          y == <emphasis role="red">c</emphasis>.y;
     } else {
       return false;
     }
diff --git a/Doc/Sd1/CoreClasses/coreClasses.xml b/Doc/Sd1/CoreClasses/coreClasses.xml
index 0aa81518460c44b89a604283bbc51a2253d84b39..9ae0e8da446cde2705a8bafe4bd7310d281096c7 100644
--- a/Doc/Sd1/CoreClasses/coreClasses.xml
+++ b/Doc/Sd1/CoreClasses/coreClasses.xml
@@ -358,9 +358,9 @@ public boolean equals(Object anObject) {
       <programlisting language="java">public class Rectangle {
     int width, height;
     @Override public boolean equals(Object o) {
-        if (o instanceof  Rectangle) {
-            return width == ((Rectangle) o).width
-                    &amp;&amp; height == ((Rectangle) o).height;
+        if (o instanceof  Rectangle <emphasis role="red">r</emphasis>) {
+            return width == <emphasis role="red">r</emphasis>.width
+                    &amp;&amp; height == <emphasis role="red">r</emphasis>.height;
         } else {
             return false;
         }
@@ -464,11 +464,10 @@ public boolean equals(Object anObject) {
 
   @Override
   public boolean equals(final Object o) {
-    if (o instanceof TimePeriod) {
-      final TimePeriod other = (TimePeriod) o;
-      return hours == other.hours &amp;&amp;
-          minutes == other.minutes &amp;&amp;
-          seconds == other.seconds;
+    if (o instanceof TimePeriod <emphasis role="red">t</emphasis>) {
+      return hours == <emphasis role="red">t</emphasis>.hours &amp;&amp;
+          minutes == <emphasis role="red">t</emphasis>.minutes &amp;&amp;
+          seconds == <emphasis role="red">t</emphasis>.seconds;
     } else {
       return false;
     }
diff --git a/Doc/Sd1/Inheritance/inheritance.xml b/Doc/Sd1/Inheritance/inheritance.xml
index b2067bb3d4a7cc2a00154746dbb94f7ada62a1d2..8d09d39fcc8140661313be9df2d0d8ebb487303a 100644
--- a/Doc/Sd1/Inheritance/inheritance.xml
+++ b/Doc/Sd1/Inheritance/inheritance.xml
@@ -351,12 +351,11 @@ public <link
   ...
   @Override <co linkends="sda_inherit_fig_ShapeEquals-1"
           xml:id="sda_inherit_fig_ShapeEquals-1-co"/> public boolean equals(final Object o) {
-    if (o instanceof Shape <co linkends="sda_inherit_fig_ShapeEquals-2"
-          xml:id="sda_inherit_fig_ShapeEquals-2-co"/>) {
-      final Shape other = (Shape) o; <co
-          linkends="sda_inherit_fig_ShapeEquals-3"
-          xml:id="sda_inherit_fig_ShapeEquals-3-co"/>
-      return x == other.x &amp;&amp; y == other.y; <co
+    if (o instanceof Shape <emphasis role="red">s</emphasis> <co
+          linkends="sda_inherit_fig_ShapeEquals-2"
+          xml:id="sda_inherit_fig_ShapeEquals-2-co"/>) { 
+      return x == <emphasis role="red">s</emphasis>.x &amp;&amp; y == <emphasis
+          role="red">s</emphasis>.y; <co
           linkends="sda_inherit_fig_ShapeEquals-4"
           xml:id="sda_inherit_fig_ShapeEquals-4-co"/>
     } else {
@@ -377,12 +376,6 @@ public <link
           object?</para>
         </callout>
 
-        <callout arearefs="sda_inherit_fig_ShapeEquals-3-co"
-                 xml:id="sda_inherit_fig_ShapeEquals-3">
-          <para>Casting other object to class
-          <classname>Shape</classname>.</para>
-        </callout>
-
         <callout arearefs="sda_inherit_fig_ShapeEquals-4-co"
                  xml:id="sda_inherit_fig_ShapeEquals-4">
           <para>Return <code language="java">true</code> if and only if both
@@ -403,11 +396,11 @@ public <link
       <programlisting language="java">public class Rectangle extends Shape {
   ...
   @Override public boolean equals(final Object o) {
-    if (o instanceof Rectangle) {
-      final Rectangle other = (Rectangle) o;
+    if (o instanceof Rectangle <emphasis role="red">r</emphasis>) {
       return super.equals(o) <co linkends="sda_inherit_fig_RectangleEquals-1"
           xml:id="sda_inherit_fig_RectangleEquals-1-co"/> &amp;&amp;
-             width == other.width &amp;&amp; height == other.height <co
+             width == <emphasis role="red">r</emphasis> &amp;&amp; height == <emphasis
+          role="red">r</emphasis> <co
           linkends="sda_inherit_fig_RectangleEquals-2"
           xml:id="sda_inherit_fig_RectangleEquals-2-co"/>;
     } else {
@@ -590,7 +583,7 @@ if (day.equals(Day.FRIDAY)) ... // Oops: NPE approaching ...</programlisting>
     <title>Overriding toString()</title>
 
     <figure xml:id="sda_inherit_fig_shapeInstanceLog">
-      <title> Printing a <classname>Shape</classname>'s info</title>
+      <title>Printing a <classname>Shape</classname>'s info</title>
 
       <informaltable border="0">
         <tr>
@@ -1820,12 +1813,13 @@ System.out.print(c.equals(c));    //<emphasis role="red">true</emphasis>: Object
       <programlisting language="java">public class Rectangle extends Shape {
     @Override public boolean equals(Object o) {
     if (o <link
-          xlink:href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.20.2">instanceof</link> Rectangle) {
+          xlink:href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.20.2">instanceof</link> Rectangle <emphasis
+          role="red">r</emphasis>) {
 
       final Rectangle oRectangle = (Rectangle) o; // Cast is «legal»
-      return super.equalCenter(oRectangle) &amp;&amp;
-             Math.abs(oRectangle.width- width) +
-                 Math.abs(oRectangle.height- height) &lt; 1.E-15;
+      return super.equalCenter(<emphasis role="red">r</emphasis>) &amp;&amp;
+             Math.abs(<emphasis role="red">r</emphasis>.width- width) +
+                 Math.abs(<emphasis role="red">r</emphasis>.height- height) &lt; 1.E-15;
     }
     return false;
   }
@@ -1837,65 +1831,6 @@ System.out.print(c.equals(c));    //<emphasis role="red">true</emphasis>: Object
       Rectangle</code> evaluates to <code language="java">false</code>.</para>
     </figure>
 
-    <qandaset defaultlabel="qanda" xml:id="sd1_qanda_whyLegalCast">
-      <title>Why is <code language="java">oRectangle = (Rectangle) o</code> a
-      legal cast?</title>
-
-      <qandadiv>
-        <qandaentry>
-          <question>
-            <para>We consider:</para>
-
-            <programlisting language="java">Object o = new Scanner(System.in);
-String s = (String) o;</programlisting>
-
-            <para>On execution we receive a <classname
-            xlink:href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/ClassCastException.html">java.lang.ClassCastException</classname>:</para>
-
-            <screen>Exception in thread "main" java.lang.ClassCastException: 
-  class java.util.Scanner cannot be cast to class java.lang.String 
- at q.App.main(App.java:20)</screen>
-
-            <para>The comment in <xref
-            linkend="sd1_inherit_fig_rectangleEquals"/> states the following
-            cast to be legal:</para>
-
-            <programlisting language="java">final Rectangle oRectangle = (Rectangle) o; // Cast is «legal»</programlisting>
-
-            <para>Why is this claim indeed true?</para>
-
-            <para>Don't try digging too deep: The answer is quite
-            simple.</para>
-          </question>
-
-          <answer>
-            <para>The cast in question appears within the following <code
-            language="java">if</code> block:</para>
-
-            <programlisting language="java">if (o <link
-                xlink:href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.20.2">instanceof</link> Rectangle) {
-   final Rectangle oRectangle = (Rectangle) o;
-  ...
-}</programlisting>
-
-            <para>Thus the cast will only be executed if our variable <code
-            language="java">o</code> actually refers to an instance of class
-            <classname>Rectangle</classname>. In other words: The <code
-            language="java">if</code> block guards our code against illegal
-            cast attempts.</para>
-
-            <para>Rewriting our faulty code accordingly also removes the
-            initial example's runtime exception:</para>
-
-            <programlisting language="java">Object o = new Scanner(System.in);
-if (o <link xlink:href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.20.2">instanceof</link> String) {
-   String s = (String) o;  // Unreachable code
-}</programlisting>
-          </answer>
-        </qandaentry>
-      </qandadiv>
-    </qandaset>
-
     <figure xml:id="sd1_inherit_fig_circleEquals">
       <title>Implementing <classname>Circle</classname>.<methodname
       xlink:href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)">equals()</methodname></title>
@@ -1903,10 +1838,10 @@ if (o <link xlink:href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-15
       <programlisting language="java">public class Circle extends Shape {
   @Override public boolean equals(final Object o) {
     if (o <link
-          xlink:href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.20.2">instanceof</link> Circle){
-      final Circle oCircle = (Circle) o;
-      return super.equalCenter(o) &amp;&amp;
-        Math.abs(oCircle.radius - radius) &lt; 1.E-15;
+          xlink:href="https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.20.2">instanceof</link> Circle <emphasis
+          role="red">c</emphasis>){
+      return super.equalCenter(<emphasis role="red">c</emphasis>) &amp;&amp;
+        Math.abs(<emphasis role="red">c</emphasis>.radius - radius) &lt; 1.E-15;
     }
     return false;
   } ...</programlisting>