diff --git a/generate_all_operators.py b/generate_all_operators.py
index af0761acb0cb978b2401254810f65e6fe32ab34d..bb903a6192837b43e15e3e57c022d0d163d40de3 100644
--- a/generate_all_operators.py
+++ b/generate_all_operators.py
@@ -25,7 +25,6 @@ import re
 from typing import Callable, List, Sequence, Set, Tuple, Union
 
 from pystencils.types import PsNumericType
-import sympy as sp
 from sympy.core.cache import clear_cache
 from tabulate import tabulate
 
@@ -37,7 +36,6 @@ from hog.blending import (
     ParametricMap,
     AffineMap2D,
 )
-from hog.cse import CseImplementation
 from hog.element_geometry import (
     ElementGeometry,
     TriangleElement,
@@ -88,10 +86,7 @@ from hog.operator_generation.loop_strategies import (
     SAWTOOTH,
     CUBES,
 )
-from hog.operator_generation.operators import (
-    HyTeGElementwiseOperator,
-    MacroIntegrationDomain,
-)
+from hog.operator_generation.operators import HyTeGElementwiseOperator
 
 from operator import itemgetter
 from hog.operator_generation.optimizer import (
diff --git a/hog/operator_generation/function_space_implementations/p2_plus_bubble_space_impl.py b/hog/operator_generation/function_space_implementations/p2_plus_bubble_space_impl.py
index d8616bf81f14c824a6395189d1308d5178b00a06..13463eb6dbdf3e74fe50eb963fe41c18e4010aed 100644
--- a/hog/operator_generation/function_space_implementations/p2_plus_bubble_space_impl.py
+++ b/hog/operator_generation/function_space_implementations/p2_plus_bubble_space_impl.py
@@ -14,31 +14,21 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
-import itertools
-import numpy as np
 import sympy as sp
-from typing import List, Tuple, Set, Union, Dict
+from typing import List, Tuple, Set, Union
 
 import pystencils as ps
-from pystencils import Field, FieldType
+from pystencils import Field
 from pystencils.backend.ast import PsAstNode
 from pystencils.backend.kernelcreation import KernelCreationContext
 from pystencils.types import PsType
 
 from hog.element_geometry import ElementGeometry
-from hog.exception import HOGException
-from hog.function_space import (
-    FunctionSpace,
-    LagrangianFunctionSpace,
-    TensorialVectorFunctionSpace,
-    N1E1Space,
-)
+from hog.function_space import FunctionSpace
 from hog.operator_generation.indexing import (
     CellType,
     FaceType,
     VolumeDoFMemoryLayout,
-    micro_element_to_vertex_indices,
-    micro_vertex_to_edge_indices,
     micro_element_to_volume_indices,
     IndexingInfo,
 )