make the flash logic a little cleaner