cpu-boot: refactor