switched to templates