refactoring tags classes