Exception changes + refactoring