diff --git a/ws/Docbook/CustomLayer/webhelp/hdmextensions.xsl b/ws/Docbook/CustomLayer/webhelp/hdmextensions.xsl
index 603ec4fd8febe8d5b9e296d7dce47b8d3ae324ff..22c7840e725244108bc803112fb96685bffb6411 100644
--- a/ws/Docbook/CustomLayer/webhelp/hdmextensions.xsl
+++ b/ws/Docbook/CustomLayer/webhelp/hdmextensions.xsl
@@ -91,19 +91,10 @@
       <xsl:call-template name="process.qandaset"/>
     </div>
     
-    <xsl:variable name="qandaId" select="@xml:id"/>
-    <xsl:variable name="tid" select="$topicLookup/map/entry[@id = $qandaId]/@tid"/>
-    <div class="bbForum" data-tid="{$tid}">
-      <p>
-        <a target="_blank">
-          <xsl:attribute name="href">
-            <xsl:text>https://bb.mi.hdm-stuttgart.de/topic/</xsl:text>
-            <xsl:value-of select="$tid"/>
-          </xsl:attribute>
-          <xsl:text>Create comment</xsl:text>
-        </a>
-      </p>
-    </div>
+    <xsl:call-template name="bbComent">
+      <xsl:with-param name="elementId" select="@xml:id"/>
+    </xsl:call-template>
+    
   </xsl:template>
   
   <xsl:template match="d:figure">
@@ -126,9 +117,16 @@
       <xsl:with-param name="placement" select="$placement"/>
     </xsl:call-template>
 
-    <xsl:variable name="figureId" select="@xml:id"/>
-    <xsl:variable name="tid" select="$topicLookup/map/entry[@id = $figureId]/@tid"/>
-    <div class="bbForum" data-tid="{$tid}">
+    <xsl:call-template name="bbComent">
+      <xsl:with-param name="elementId" select="@xml:id"/>
+    </xsl:call-template>
+
+  </xsl:template>
+  
+  <xsl:template name="bbComent">
+    <xsl:param name="elementId"/>
+    <xsl:variable name="tid" select="$topicLookup/map/entry[@id = $elementId]/@tid"/>
+    <div class="bbForum" data-tid="$tid">
       <p>
         <a target="_blank">
           <xsl:attribute name="href">
@@ -139,7 +137,6 @@
         </a>
       </p>
     </div>
-    
   </xsl:template>
   
   <!-- Modify navigation bar from webhelp-common.xsl -->