Refactors code to reflect use of angularfire bindings