moved ref_flag into separate module