Refactor error handling code