Tidy up firebase JS