Use type of dataset children to get the template instead of dataset's type.