some refinements and corrections before tagging