some fixing to templates