added gateway for the choice of the template, based on the presence or not of the attributes