-cat src/layout.html | grep -v '</body>' | grep -v '</html>' | sed -e 's/BODYID/deletable-page/' > dist/deletable.html
-echo '<script id="deletable-template" type="text/x-handlebars-template">' >> dist/deletable.html
-cat src/templates/deletable.hbs >> dist/deletable.html
-echo '</script>' >> dist/deletable.html
-echo '</body>' >> dist/deletable.html
-echo '</html>' >> dist/deletable.html
-
-cat src/layout.html | grep -v '</body>' | grep -v '</html>' | sed -e 's/BODYID/polygons-page/' > dist/polygons.html
-echo '<script id="polygons-template" type="text/x-handlebars-template">' >> dist/polygons.html
-cat src/templates/polygons.hbs >> dist/polygons.html
-echo '</script>' >> dist/polygons.html
-echo '</body>' >> dist/polygons.html
-echo '</html>' >> dist/polygons.html
+{
+ sed -e 's/BODYID/polygons-page/' src/layout.html | grep -v '</body>' | grep -v '</html>'
+ echo '<script id="polygons-template" type="text/x-handlebars-template">'
+ cat src/templates/polygons.hbs
+ echo '</script>'
+ echo '</body>'
+ echo '</html>'
+} > dist/polygons.html