move firebase calls to data layer