clean up state and brostate