refactor to double firebase lookup