refactoring how errors are handled