added Firebase calls to a factory