put firebase repetitive code into dataService