Cleaned up kernel_main()