Clean `kernel_main()` up.