Refactor exceptions samples