Refactoring, remove undefined exceptions