refactored Bootloader