Small refactoring on closing all tabs