Split common routines from kboot parser