refactoring for angularfire 0.8.0 compatability