Removing outer elements in templates