Move kernels to source files