diff --git a/test/harmonicenergytest.cc b/test/harmonicenergytest.cc
index 21e418a1be84032d4463023e16f720af96de20f5..c73e15e1c76bb4b6cbb1d8a3292c325c99d56e90 100644
--- a/test/harmonicenergytest.cc
+++ b/test/harmonicenergytest.cc
@@ -13,7 +13,6 @@
 
 const int dim = 2;
 
-typedef UnitVector<double,3> TargetSpace;
 
 using namespace Dune;
 
@@ -28,7 +27,7 @@ double diameter(const std::vector<TargetSpace>& v)
     return d;
 }
 
-template <class Basis>
+template <class Basis, class TargetSpace>
 void testEnergy(const Basis& basis, const std::vector<TargetSpace>& coefficients)
 {
     using GridView = typename Basis::GridView;
@@ -62,8 +61,8 @@ void testEnergy(const Basis& basis, const std::vector<TargetSpace>& coefficients
 }
 
 
-template <int domainDim>
-void testUnitVector3d()
+template <int domainDim, class TargetSpace>
+void test()
 {
     // ////////////////////////////////////////////////////////
     //   Make a test grid consisting of a single simplex
@@ -128,5 +127,5 @@ int main(int argc, char** argv)
 {
     MPIHelper::instance(argc, argv);
 
-    testUnitVector3d<2>();
+    test<2,UnitVector<double,3> >();
 }