To serialize the tabs status, we need to precalculate every tab
status, so we need to refactor some code.