Split doFlash() to do_flash() and do_download() methods.