Markup cleanup and Analytics