Split firebase code to its own file