WIP: refining arrow_flag with apply_flag