cleaned up dealing with tags