Switch to factory functions for exceptions in Checks.