Support flat and template types