better commenting around error handling