re-arrange bootloader installation code