Simplify handling of errors