Refactor tabs with forEach loop