streamlining error handling