Simplifed function which does tag cleanup