Split kernel_init() into two functions