firebase-angular: refactor controller