Refactor Firebase API and identifiers