restructure firebase