Improve tab management