refine boot code