reorganized code to make it clearer who's doing what and to make it easier to skip the flag_broad_rfi step