refractored handling of external restraints