change data reading to use Map structure