Create child classes so they inherit the code, Or use one class as a dynamic parent replacing the mesh on initialization.