move logic to TagsController