Add template constraints