Refactor tag service