Further changes accordingt to reading and writing data to/from firebase.