Initial code for exceptions refactoring.