better assignation and deletion of tags