refactoring tags and posts