exception functions refactored.