Convert readField from recursive to iterative.