Cleans up the readRecord to use map.