Refactor tags service