moved generation of firebase token to a central place