cleanup unused attributes in template