Some refactoring.
Some refactoring.

Change-Id: Ia3fd1972c95c9d4a7fce6c36e3b10338f72bc33c

firebase/quickstart-js,yochannah/trafficuk,DaryaBeda/firebase_,robforee/YA,theGove/atlas,robforee/YA,firebase/quickstart-js,theGove/atlas,uhntiss/quickstart-js,uhntiss/quickstart-js,DES157/quickstart-js,uhntiss/quickstart-js,jmarantz/soccersub,DaryaBeda/firebase_,yochannah/trafficuk,robforee/YA,firebase/quickstart-js,jmarantz/soccersub,jmarantz/soccersub,DES157/quickstart-js