Externalize the ref and error keys