extract out firebase stuff