Refactoring
test error handler