splitting the reading in multiple functions