diff --git a/php/templates/components/container-state.twig b/php/templates/components/container-state.twig
new file mode 100644
index 00000000..cdf70016
--- /dev/null
+++ b/php/templates/components/container-state.twig
@@ -0,0 +1,23 @@
+{# @var c \App\Containers\Container #}
+
+ {% if c.GetStartingState().value == 'starting' %}
+
+ {% elseif c.GetRunningState().value == 'running' %}
+
+ {% else %}
+
+ {% endif %}
+
+ {{ c.GetDisplayName() }}
+ (Stopped)
+ {% if c.GetDocumentation() != '' %}
+ (docs)
+ {% endif %}
+
+ {% if c.GetUiSecret() != '' %}
+
+ Show password
+ {{ c.GetUiSecret() }}
+
+ {% endif %}
+
\ No newline at end of file
diff --git a/php/templates/containers.twig b/php/templates/containers.twig
index 1124c51a..96687dac 100644
--- a/php/templates/containers.twig
+++ b/php/templates/containers.twig
@@ -275,39 +275,7 @@
{# @var containers \AIO\Container\Container[] #}
{% for container in containers %}
{% if container.GetDisplayName() != '' %}
-
- {% if container.GetStartingState().value == 'starting' %}
-
- {{ container.GetDisplayName() }} (Starting)
- {% if container.GetDocumentation() != '' %}
- (docs)
- {% endif %}
- {% if container.GetUiSecret() != '' %}
- (password: {{ container.GetUiSecret() }})
- {% endif %}
-
- {% elseif container.GetRunningState().value == 'running' %}
-
- {{ container.GetDisplayName() }} (Running)
- {% if container.GetDocumentation() != '' %}
- (docs)
- {% endif %}
- {% if container.GetUiSecret() != '' %}
- (password: {{ container.GetUiSecret() }})
- {% endif %}
-
- {% else %}
-
- {{ container.GetDisplayName() }} (Stopped)
- {% if container.GetDocumentation() != '' %}
- (docs)
- {% endif %}
- {% if container.GetUiSecret() != '' %}
- (password: {{ container.GetUiSecret() }})
- {% endif %}
-
- {% endif %}
-
+ {% include 'components/container-state.twig' with {'c': container} only %}
{% endif %}
{% endfor %}