Hint factory safe

The branch with hint factory stuff.
Can we put exceptions at the top of files?