fix template structure