refactor tags operations