Extracted read - swap code to separate functions. Added validation code to field reading.