Refactored to use firebase instead of cache factory