Cleanup boot_module() to be a bit more readable