Ok I got confused, if setH works, then that's better
otherwise it would also be possible to get the kernel class just once `kernel_class = kernel_switch[kernel]` or something like that.