90% function except team settings and view destruction