refactor tag module