refactor for new firebase rules