This `prevents` method is used elsewhere.  Might it be worthwhile to extract it into a common helper module?