template structure fixes