begin refac of kernel loader