Refactor unexpected input failure to method.