remove unnecessary tags and classes from template