Refactor and upgrade dependency to firebase