Removing content markup and adding logic