simplify get_extra_restriction code