Remove duplicate tags_count code