a lot of refactor on tags