refactoring. tracking tag frequency