refactored kernels