Refactored some stuff to use new firebase api