Kernel refactor