Adding template conditions