Refacted reading data files