Refactor corepage

Reduce duplicate codes about tabs