rewriting the data resource reader code