diff --git a/python/dune/perftool/blockstructured/__init__.py b/python/dune/perftool/blockstructured/__init__.py
index 1c82f0a106672094021c3923179d34fea8b23195..0185e2cbf7f39d080240c3f7e358323fe88a698a 100644
--- a/python/dune/perftool/blockstructured/__init__.py
+++ b/python/dune/perftool/blockstructured/__init__.py
@@ -11,7 +11,6 @@ from dune.perftool.blockstructured.geometry import (pymbolic_jacobian_inverse_tr
                                                     pymbolic_jacobian_determinant,
                                                     pymbolic_facet_jacobian_determinant,
                                                     to_global)
-from dune.perftool.blockstructured.basis import pymbolic_reference_gradient
 from dune.perftool.blockstructured.tools import sub_element_inames
 
 from dune.perftool.pdelab import PDELabInterface
diff --git a/python/dune/perftool/blockstructured/basis.py b/python/dune/perftool/blockstructured/basis.py
index efbe091579e666614d134170b307b8b8e180cece..84353a338aa7ab1453b2af3a748ff6a8f37f5385 100644
--- a/python/dune/perftool/blockstructured/basis.py
+++ b/python/dune/perftool/blockstructured/basis.py
@@ -8,7 +8,6 @@ from dune.perftool.generation import (backend,
                                       initializer_list,
                                       include_file,)
 from dune.perftool.tools import get_pymbolic_basename
-# TODO clean up some imports
 from dune.perftool.pdelab.basis import (declare_cache_temporary,
                                         name_localbasis_cache,
                                         type_localbasis,
@@ -60,7 +59,7 @@ def define_localbasis(leaf_element, name):
 
 
 def name_localbasis(leaf_element):
-    name = "microElementBasis"
+    name = "{}_microElementBasis".format(FEM_name_mangling(leaf_element))
     globalarg(name)
     define_localbasis(leaf_element, name)
     return name
@@ -69,7 +68,7 @@ def name_localbasis(leaf_element):
 @backend(interface="evaluate_basis", name="blockstructured")
 @kernel_cached
 def evaluate_basis(leaf_element, name, restriction):
-    temporary_variable(name, shape=(4,), decl_method=declare_cache_temporary(leaf_element, restriction, 'Function'))
+    temporary_variable(name, shape=(leaf_element.degree(),), decl_method=declare_cache_temporary(leaf_element, restriction, 'Function'))
     cache = name_localbasis_cache(leaf_element)
     qp = pymbolic_quadrature_position_in_cell(restriction)
     localbasis = name_localbasis(leaf_element)
@@ -83,7 +82,7 @@ def evaluate_basis(leaf_element, name, restriction):
 @backend(interface="evaluate_grad", name="blockstructured")
 @kernel_cached
 def evaluate_reference_gradient(leaf_element, name, restriction):
-    temporary_variable(name, shape=(4, 1, world_dimension()), decl_method=declare_cache_temporary(leaf_element, restriction, 'Jacobian'))
+    temporary_variable(name, shape=(leaf_element.degree(), 1, world_dimension()), decl_method=declare_cache_temporary(leaf_element, restriction, 'Jacobian'))
     cache = name_localbasis_cache(leaf_element)
     qp = pymbolic_quadrature_position_in_cell(restriction)
     localbasis = name_localbasis(leaf_element)
@@ -92,14 +91,3 @@ def evaluate_reference_gradient(leaf_element, name, restriction):
                 assignees=frozenset({name}),
                 read_variables=frozenset({get_pymbolic_basename(qp)}),
                 )
-
-
-@backend(interface="pymbolic_reference_gradient", name="blockstructured")
-def pymbolic_reference_gradient(leaf_element, restriction, number, context=''):
-    assert leaf_element.num_sub_elements() == 0
-    name = "js_{}".format(FEM_name_mangling(leaf_element))
-    name = restricted_name(name, restriction)
-    evaluate_reference_gradient(leaf_element, name, restriction)
-    inames = lfs_inames(leaf_element, restriction, number, context=context)
-
-    return prim.Subscript(prim.Variable(name), (tensor_index_to_sequential_index(inames,2), 0))
\ No newline at end of file
diff --git a/python/dune/perftool/blockstructured/spaces.py b/python/dune/perftool/blockstructured/spaces.py
index 97a6f027ecf8e01d764e43b103e8e05ebf4a9e0c..95eb919f94f10e14b371c48326510eb24ea6358d 100644
--- a/python/dune/perftool/blockstructured/spaces.py
+++ b/python/dune/perftool/blockstructured/spaces.py
@@ -1,6 +1,7 @@
 from dune.perftool.generation import (backend,
                                       domain)
 from dune.perftool.pdelab.geometry import world_dimension
+from dune.perftool.pdelab.spaces import name_leaf_lfs
 
 
 @backend(interface="lfs_inames", name="blockstructured")
@@ -12,7 +13,9 @@ def lfs_inames(element, restriction, count=None, context=''):
         else:
             context = str(count)
 
-    name = "micro_{}_index".format(context)
-    domain(name, pow(2,world_dimension()))
+    lfs = name_leaf_lfs(element, restriction)
+
+    name = "micro_{}_{}_index".format(lfs, context)
+    domain(name, pow(element._degree+1,world_dimension()))
 
     return (name, )
diff --git a/python/dune/perftool/pdelab/driver.py b/python/dune/perftool/pdelab/driver.py
index 7c8a92557a137c76e83a4739a4a369f9b99e30b7..1e92e67c183c2869b39eef89646369ad9b441d30 100644
--- a/python/dune/perftool/pdelab/driver.py
+++ b/python/dune/perftool/pdelab/driver.py
@@ -1791,8 +1791,7 @@ def generate_driver(formdatas, data):
 
     #TODO find a better solution ...
     if get_option("blockstructured"):
-        degree = _driver_data["form"].coefficients()[0].ufl_element()._degree
-        _driver_data["form"].coefficients()[0].ufl_element()._degree = get_option("number_of_blocks")
+        set_blockstructured_degree()
 
     # Entrypoint for driver generation
     if get_option("opcounter") or get_option("time_opcounter"):
@@ -1844,4 +1843,4 @@ def generate_driver(formdatas, data):
 
     #TODO find a better solution ...
     if get_option("blockstructured"):
-        _driver_data["form"].coefficients()[0].ufl_element()._degree = degree
+        unset_blockstructured_degree()