Refactored all tagging state code into TagsService.